I'm using Mocha and Chai to do some front end testing and put in the below assertion.
it('AddContact returns contact with type = ADD_CONTACT', function () {
function hi() {return {
type: 'ADD_CONTACT',
data: {
firstName: 'John',
lastName: 'Doe',
dateOfBirth: '1/2/89',
phone: '123-456-7890',
email: 'jdoe@gmail.com',
notes: 'Most original name ever'
}}}
expect(hi()).to.equal({
type: 'ADD_CONTACT',
data: {
firstName: 'John',
lastName: 'Doe',
dateOfBirth: '1/2/89',
phone: '123-456-7890',
email: 'jdoe@gmail.com',
notes: 'Most original name ever'
}
});
});
However, I still get the error:
AssertionError: expected { Object (type, data) } to equal { Object (type, data) }
+ expected - actual
What's going on?