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

Bug with docs/isRejected(promise, message)? #246

Closed
James-Firth opened this issue Jun 7, 2018 · 0 comments
Closed

Bug with docs/isRejected(promise, message)? #246

James-Firth opened this issue Jun 7, 2018 · 0 comments

Comments

@James-Firth
Copy link
Contributor

I think this just needs a PR to update the docs, but I am making an issue in case this is a bug with how isRejected function.


On line 86 of the README it has an example for the assert interface:
return assert.isRejected(promise, "optional message");
However, I don't think the string ever gets treated as a message, and instead as an error message matcher.

From what I can see if you called assert.isRejected(promise, msg) it would call L321 and pass along your message as the errorLike. isRejected calls rejectedWith. Looking at Line 153 of the library the original msg string would now be set to the errMsgMatcher. Which is not the intended behaviour as per the docs.

I think the solution is just update the docs, right? Or should you have the ability to just set a message on its own?

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

No branches or pull requests

1 participant