January 2018
Beginner
658 pages
13h 10m
English
To check if the two names are equal, we'll have to use something different. It's called toEqual as shown here:
it('should expect some values', () => { // expect(12).toNotBe(12); expect({name: 'Andrew'}).toEqual({name: 'Andrew'});});
If we save the file now, this will work. It'll rip into the object properties, making sure they have the same ones:

The same thing goes for toNotEqual. This checks if two objects are not equal. To check this, we'll go ahead and change the first object to have a lowercase a in andrew:
it('should expect some values', () => { // expect(12).toNotBe(12); expect({name: 'andrew'}).toNotEqual({name: ...Read now
Unlock full access