-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add Must.prototype.permutationOf #16
Conversation
Hey @moll, what's your take on this pull request? Is it something you are willing to accept into the project? |
Hey, Miroslav! Thank you very much for taking the time to share this! Absolutely! I simply hadn't had the moment to handle this yet. Would you do me two quick favors please?
You can use Git's Thank you again! |
@moll You are welcome. I have amended the commit per your instructions, also added Let me know if there is anything else to improve. |
@moll ping. is there anything else to fix before this can be merged and released? |
The proper implementation will be available when the pull request moll/js-must#16 is merged and released.
Nah, sorry, you've been perfect. Thank you! It's been me. :-)
|
Hey again, @bajtos. So, I went about merging this and then realized The issue (#6) which @koresar raised talks about So, what's your stance on this? Has any better sounding word crossed your mind? It is equivalence of sorts, but naming it Some names that I could think of were [1, 2, 3].must.have.onlyMembers([1, 2])
[1, 2, 3].must.be.set([1, 2]) The latter could, in theory, interfere with the typeof matchers like Another could be Anyways, as Phil Karlton said:
|
A side note to remember when testing with a [1, 2, 3, 2, 1].must.have.members([1, 2, 3]) |
Agreed. Perhaps Regardless of |
Few ideas:
I think |
Absolutely, no problem with adding both Indeed, Chai has its chainable thingies. While I'd like to simplify this and have a separate dedicated matcher for separate behaviors, even with their chains they must've picked one as the default. Looks to me like they picked subset (http://chaijs.com/api/bdd/#members). Chai's assert interface has separated them to |
You probably meant
Following the unwritten rule of longer being stricter, that wouldn't work well. :/
That's a great idea! I'm with you that it's so far the best. |
Reworked to |
Assert the array have the same members, possibly in a different order.
Thank you again! Merged and released v0.12.0 with |
This is similar to
have members
from chai.It would be nice to have
include members
oris subset of
too, but that can be implemented in a different patch.