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

Include should validate number of arguments #83

Closed
blacksun1 opened this issue Aug 23, 2016 · 0 comments
Assignees
Labels
Milestone

Comments

@blacksun1
Copy link
Contributor

@blacksun1 blacksun1 commented Aug 23, 2016

Hi,

We have been moving some large code bases from Mocha/Chai to Lab/Code and have found the experience very good. One issue we've found though has been converting from chai's .property('foo', 'bar') to Codes .includes({'foo': 'bar'}).

We tend to find that we sometimes forget to change the 2 string arguments to a single object argument but Code does not warn us therefore only the member existence check is being done - not the equality check.

It would be great if the method would validate the number of arguments and fail if more than one argument was given.

blacksun1 added a commit to blacksun1/code that referenced this issue Aug 23, 2016
Added an extra assertion to check that the include expectation is always
called with just one argument.

Fixes: hapijs#83
@cjihrig cjihrig closed this in #84 Aug 28, 2016
cjihrig added a commit that referenced this issue Aug 28, 2016
* Enhancement: Added validation to include

Added an extra assertion to check that the include expectation is always
called with just one argument.

Fixes: #83

* Fix: Fix tests as per comments

Fix as per [Pull request 84](#84)

* Fix: Fix tests as per pull request comments

Second refactor to fix tests as per
[Pull request 84](#84)

* Refactor: Refactor as per pull comments

> I think this second test can be dropped, as the functionality is
> tested elsewhere.
> --cjihrig
@cjihrig cjihrig added the feature label Sep 10, 2016
@cjihrig cjihrig added this to the 4.0.0 milestone Sep 10, 2016
@cjihrig cjihrig self-assigned this Sep 10, 2016
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.