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

Invalidates rejection with wrong type or message arguments #121

Merged
merged 2 commits into from Jan 2, 2018

Conversation

@ferrao
Copy link
Contributor

ferrao commented Dec 12, 2017

Fixes #119

@cjihrig

This comment has been minimized.

Copy link
Contributor

cjihrig commented Dec 13, 2017

This is a step in the right direction. I think the type checking and argument parsing in general still has a way to go. For example:

await Code.expect(Promise.reject(new Error('kaboom'))).to.reject(NaN);

NaN and a number of other falsey values don't cause this code to fail.

@ferrao

This comment has been minimized.

Copy link
Contributor Author

ferrao commented Dec 14, 2017

@cjihrig I just tackled the problem that I noticed/was having, which was the message argument having a type different from string or regex. I did not realised the type argument had issues as well, will take a stab at it and resubmit again.

@ferrao

This comment has been minimized.

Copy link
Contributor Author

ferrao commented Dec 15, 2017

@cjihrig, just pushed a new commit to check the type argument as well.

@ferrao ferrao changed the title Invalidates rejection with wrong message type. Closes #119 Invalidates rejection with wrong type or message arguments Dec 15, 2017
@ferrao

This comment has been minimized.

Copy link
Contributor Author

ferrao commented Dec 22, 2017

@cjihrig do you think the current checks and tests are sufficient?

Copy link
Contributor

cjihrig left a comment

Thanks. LGTM

@cjihrig cjihrig merged commit 6bf9d1d into hapijs:master Jan 2, 2018
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@cjihrig cjihrig self-assigned this Jan 2, 2018
@cjihrig cjihrig added this to the 5.1.3 milestone Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.