Repository navigation
Add match.every and match.some (#1624) - #1661
Merged
Merged
Conversation
Added new matcher - match.every, which matches on an object or iterable if all of the properties (or elements, respectively) match the given predicate.
Added new matcher - match.some, which matches on an object or iterable if some of the properties (or elements, respectively) match the given predicate.
mroderick
requested changes
Jan 17, 2018
mroderick
left a comment
Member
There was a problem hiding this comment.
This is a very nice pull request!
For the code, I only have the one comment about preferring refute over assert.isFalse.
Would you mind adding documentation for the new methods?
There's docs/CONTRIBUTING.md to get you started on the right foot.
| it("fails to match anything that is not an object or an iterable", function () { | ||
| var every = sinonMatch.every(sinonMatch.any); | ||
|
|
||
| assert.isFalse(every.test(1)); |
Member
There was a problem hiding this comment.
Instead of using assert.isFalse, you can use refute... you just have to import it from referee at the top of the file.
Switching to refute in match.every and match.some tests
Contributor
Author
|
Thanks for your feedback @mroderick. Edited the tests and added documentation for the new matchers. |
mroderick
approved these changes
Jan 21, 2018
Member
|
This has caused tests in IE11 for |
Member
|
This has been released as |
Closed
mroderick
added a commit
to mroderick/sinon
that referenced
this pull request
Jan 21, 2018
This would have prevented the failing build in master that occurred after merging sinonjs#1661, which would have allowed the author to fix it.
Merged
mantoni
pushed a commit
that referenced
this pull request
Jan 21, 2018
This would have prevented the failing build in master that occurred after merging #1661, which would have allowed the author to fix it.
franck-romano
pushed a commit
to franck-romano/sinon
that referenced
this pull request
Oct 1, 2019
* Add match.every (sinonjs#1624) Added new matcher - match.every, which matches on an object or iterable if all of the properties (or elements, respectively) match the given predicate. * Add match.some (sinonjs#1624) Added new matcher - match.some, which matches on an object or iterable if some of the properties (or elements, respectively) match the given predicate.
franck-romano
pushed a commit
to franck-romano/sinon
that referenced
this pull request
Oct 1, 2019
This would have prevented the failing build in master that occurred after merging sinonjs#1661, which would have allowed the author to fix it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add match.every and match.some as requested in issue #1624.
Steps to verify: