chai equal object code example
Example 1: chai length greater than
expect('foo').to.have.lengthOf(3); // Recommended
expect('foo').to.have.lengthOf.above(2); // Not recommended
expect([1, 2, 3]).to.have.lengthOf(3); // Recommended
expect([1, 2, 3]).to.have.lengthOf.above(2); // Not recommended
Example 2: chai expect array without order
expect([2, 1, 3].sort()).to.eql([3, 1, 2].sort())