Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assert.notEqual passes when 2 different objects have the same values #30

Closed
astorije opened this issue Oct 29, 2015 · 0 comments
Closed
Labels

Comments

@astorije
Copy link
Owner

The following test fails (see this build):

var list3 = List.of(1, 2, 3);
var deepMap = new Map({ foo: 'bar', list: List.of(1, 2, 3) });
var sameDeepMap = new Map({ foo: 'bar', list: List.of(1, 2, 3) });

it('should fail given equal values', function () {
  assert.throws(function () { assert.notEqual(list3, List.of(1, 2, 3)); }, Error);
});

it('should fail given deeply equal values', function () {
  assert.throws(function () { assert.notEqual(deepMap, sameDeepMap); }, Error);
});

This shows that assert.notEqual needs to be overriden to take into account equality between values even though the underlying objects are different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant