Skip to content

Asserts that two arguments are provided to object.with() and object.without()#1395

Merged
Marsup merged 2 commits intohapijs:masterfrom
davidjamesstone:master
Jan 19, 2018
Merged

Asserts that two arguments are provided to object.with() and object.without()#1395
Marsup merged 2 commits intohapijs:masterfrom
davidjamesstone:master

Conversation

@davidjamesstone
Copy link

How does this look?

The assertion is for arguments.length === 2 rather than arguments.length <= 2 like you suggested (extra arguments).

@Marsup
Copy link
Collaborator

Marsup commented Jan 12, 2018

This method is fine as well, I'd only change the tests.
expect(() => Joi.object().with()).to.throw('Invalid number of arguments, expected 2.') would be a better way to write it.

@Marsup Marsup added the feature New functionality or improvement label Jan 12, 2018
@Marsup Marsup self-assigned this Jan 12, 2018
@davidjamesstone
Copy link
Author

I agree that form is better. I was originally following the pattern used in the xor tests.

@Marsup Marsup merged commit 0045159 into hapijs:master Jan 19, 2018
@Marsup Marsup added this to the 13.1.1 milestone Jan 19, 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
@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

feature New functionality or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants