Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

toThrow() is not implemented in test-runner. #246

Open
navedmerchant opened this issue Sep 5, 2019 · 2 comments
Open

toThrow() is not implemented in test-runner. #246

navedmerchant opened this issue Sep 5, 2019 · 2 comments

Comments

@navedmerchant
Copy link

I just checked the test runners, matchers.js and it seems like it hasnt been implemented. It def is needed to test for thrown exceptions.

@mathieudutour
Copy link
Member

mathieudutour commented Sep 5, 2019

Happy to accept a PR 👍

In the meantime you can do something like

try {
  something()
  expect(false).toBe(true)
} catch (err) {
  expect(true).toBe(true)
}

@navedmerchant
Copy link
Author

Yup, thats exactly what i did! Ill try and work something out later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants