January 2018
Beginner
658 pages
13h 10m
English
We'll start with removing the current code by commenting it out. We'll leave it around so we use it later:
it('should expect some values', () => { // expect(12).toNotBe(12);});
We'll expect an object with the name property set to Andrew, toBe, and we'll assert that it is another object where the name property is equal to Andrew, just like this:
it('should expect some values', () => { // expect(12).toNotBe(12); expect({name: 'Andrew'})});
We'll use toBe, just like we did with number, checking if it is the same as another object where name equals Andrew:
it('should expect some values', () => { // expect(12).toNotBe(12); expect({name: 'Andrew'}).toBe({name: 'Andrew'});});
Now when we save this, ...
Read now
Unlock full access