tj / should.js

BDD style assertions for node.js -- test framework agnostic
MIT License
2.75k stars 194 forks source link

add "sorted" #123

Closed erelsgl closed 11 years ago

erelsgl commented 11 years ago

I want to compare two arrays, A and B, regardless of order.

Currently I have to do this in 3 lines:

A.sort()
B.sort()
A.should.eql(B)

Since this is a common scenario, it could be very useful to do this in 1 line, for example:

A.sorted.should.eql(B.sorted)

... or something like this.

btd commented 11 years ago

I do not think it is common case and that should.js should do everything that can be tested.