Closed
Description
It would be nice to assert that two arrays have the same members, regardless of order. (This would be used when we are treating arrays as sets, which aren't widely available in js yet.)
var expect = require('chai').expect;
it('should view two arrays as equal', function() {
expect([1, 2, 3]).to.have.same.members.as([3, 2, 1]);
// alternate proposed syntax
expect([1, 2, 3]).to.be.memberEqual([3, 2, 1]);
});
Can I submit a PR for this?
Metadata
Assignees
Labels
No labels