I'm trying to understand why my simple chai (using chai-immutable) test fails.
it('should work', () => {
var currentState = Immutable.fromJS({
name: 'myName',
age: 20,
friends: []
});
var newState = currentState.merge({
name: 'someOtherName',
age: 30
});
expect(newState).to.equal(Immutable.fromJS({
name: 'someOtherName',
age: 30,
friends: []
}));
});
What am I doing wrong? I guess I'm missing something stupid...
Thanks, Amit.
Try comparing the two with Immutable.is():
let checkThis = Immutable.fromJS({
name: 'someOtherName',
age: 30,
friends: []
});
Immutable.is(newState, checkThis)//true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With