I use expect.js
and I'd like to test for set equivalence
Error: expected [ [ 1, 2 ], [ 2, 1 ], [ 0, 1 ], [ 1, 0 ] ] to sort of equal [ [ 1, 2 ], [ 2, 1 ], [ 1, 0 ], [ 0, 1 ] ]
^ this should be true.
I've found this, but how do I integrate it into expect.js
?
You can cheat by sorting the array.. (below is coffescript)
describe 'test', ->
it 'should match', ->
a = [ [ 1, 2 ], [ 2, 1 ], [ 0, 1 ], [ 1, 0 ] ]
b = [ [ 1, 2 ], [ 2, 1 ], [ 1, 0 ], [ 0, 1 ] ]
expect(a.sort()).to.eql b.sort()