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 ferrao commented Dec 12, 2017

Fixes #119

@cjihrig
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
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
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
Copy link
Contributor Author

ferrao commented Dec 22, 2017

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

Copy link
Contributor

@cjihrig cjihrig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. LGTM

@cjihrig cjihrig merged commit 6bf9d1d into hapijs:master Jan 2, 2018
@cjihrig cjihrig self-assigned this Jan 2, 2018
@cjihrig cjihrig added this to the 5.1.3 milestone Jan 2, 2018
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reject does not fail if argument is of the wrong type
2 participants