I'm trying to make an inventory system and I would like to add an Item so I made a muck up code to see how update works and I keep on getting errors on the assertion. so I used an IF ELSE statement to compare and log the result and they I always get NOT EQUAL even tho the update result(state2) is just the same as expected(state3).
const state1 = ['x','y'];
const state2 = update(state1, {$push: ['z']});
const state3 = ['x', 'y', 'z'];
expect(state2).to.equal(state3);
//log results
if (state2 === state3) {
console.log("EQUAL!!! state2 = " + state2 + ", state3 = " + state3);
} else {
console.log("NOT EQUAL!!! state2 = " + state2 + ", state3 = " + state3);
}
the assertion error I get is:
AssertionError: expected [ 'x', 'y', 'z' ] to equal [ 'x', 'y', 'z' ]