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, you might think the test will pass, but it doesn't:

As shown in the preceding output, we see that we expected the two names to be equal. When objects are compared for equality using the triple equals, which is what toBe uses, they'll not be the same because it's trying to see if they're the exact same object, and they're not. We've created two separate objects with the same properties.