Let\'s say I have the following:
var myNumber = 5; expect(myNumber).toBe(5); expect(myNumber).toEqual(5);
Both of the above tests will pass
To quote the jasmine github project,
expect(x).toEqual(y); compares objects or primitives x and y and passes if they are equivalent expect(x).toBe(y); compares objects or primitives x and y and passes if they are the same object
expect(x).toEqual(y); compares objects or primitives x and y and passes if they are equivalent
expect(x).toEqual(y);
expect(x).toBe(y); compares objects or primitives x and y and passes if they are the same object
expect(x).toBe(y);