Hey so I was playing around with Jasmine today and I wrote this simple Person object
function Person() {}
Person.prototype.name = "Alex";
Person.prototype.age = 24;
Here's my Spec test
describe("Person", function() {
var someone = new Person();
it('should be equal to other people', function() {
var another = {
name: "Joe",
age: 25,
};
expect(someone).toEqual(another);
});
});
Yet it fails with Expected { } to equal { name : 'Alex', age : 24 } Shouldn't Jasmine's toEqual matcher work for objects? Am I missing something here?
Thanks!