Automattic / expect.js

Minimalistic BDD-style assertions for Node.JS and the browser.
2.11k stars 209 forks source link

Add a way to check a value is eql to someone #134

Open emilioplatzer opened 9 years ago

emilioplatzer commented 9 years ago

expect(x).to.be.in([x1, x2, x3]) will be true if 'expect(x).to.eql(x1)` or x2 or x3.

The idea is to use with any object. Example:

expect(['encode', 'utf8']).be.in([ ['encode','utf8'], ['overwrite', false] ])

I couldn't use expect([x1, x2, x3]).to.include(x) because it uses indexOf doesn't work for objects (because implies ===).