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

Add custom matcher for rejecting a promise #74

Open
sjelin opened this issue Jan 4, 2017 · 0 comments
Open

Add custom matcher for rejecting a promise #74

sjelin opened this issue Jan 4, 2017 · 0 comments

Comments

@sjelin
Copy link
Contributor

sjelin commented Jan 4, 2017

jasminewd is great when promises resolve, but but it can be tough to test rejected promises for a few reasons:

  • expect will try to unwrap the promise, but doesn't have code to handle rejections. This will also get in the way of any user trying to write a custom matcher
  • If a WebDriver command fails and there's no rejection handler set up yet, WebDriver will crash the flow.execute command we're wrapping each it() block in.
  • Userers are used to promises being handled for them ✨magically✨

So we should add a custom marcher toBeRejected

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

1 participant