Don't use “deep equals” when comparing arrays with Chai; it depends on element order. Examine the array members instead.

// Fails
expect(['b', 'a']).to.deep.equal(['a', 'b'])

// Passes
expect(['b', 'a']).to.have.members(['a', 'b'])