1

I believe this is a bug in should.js due to a special value NaN as NaN is not equal to itself.

({
    a: 1,
    c: 3,
    b: 2,
    d: NaN
}).should.eql({
    a: 1,
    c: 3,
    b: 2,
    d: NaN
});

This test case fails while it seems pretty obivious that it should pass.

Any suggestions on how to go about on this test case?

Joon
  • 9,346
  • 8
  • 48
  • 75
  • This is a known bug in should.js: https://github.com/visionmedia/should.js/issues/38 (or maybe this is not quite the same case... hm.) – apsillers Sep 02 '13 at 23:15

1 Answers1

2

NaN is special in that it is not equal to itself.

> NaN == NaN
false

This is not a bug. NaN is not equal to anything. See MDN for more info.

tckmn
  • 57,719
  • 27
  • 114
  • 156