Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用expect.jsしており、セットの同等性をテストしたい
expect.js
Error: expected [ [ 1, 2 ], [ 2, 1 ], [ 0, 1 ], [ 1, 0 ] ] to sort of equal [ [ 1, 2 ], [ 2, 1 ], [ 1, 0 ], [ 0, 1 ] ]
^ これは正しいはずです。
これを見つけましたが、どうすれば に統合できexpect.jsますか?
配列を並べ替えることでごまかすことができます..(以下は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()