我需要做出一个断言,如果两个数组相等,那么他们使用chai的顺序是否正常:
我尝试了这种方法,但没有奏效:
expect([{a:1,b:1}, {a:2,b:2}, {a:3,b:3}]).to.deep.equal([{a:2,b:2},{a:1,b:1},{a:3,b:3}]);
答案 0 :(得分:3)
expect([{a:1,b:1}, {a:2,b:2}, {a:3,b:3}]).to.have.deep.members([{a:2,b:2},{a:1,b:1},{a:3,b:3}]);