Skip to content

Commit

Permalink
test for EJSON equality of falsy things
Browse files Browse the repository at this point in the history
  • Loading branch information
Naomi Seyfer committed Mar 1, 2013
1 parent a60f4ee commit bf81b0a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/ejson/ejson_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,12 @@ Tinytest.add("ejson - nesting and literal", function (test) {
var roundTrip = EJSON.fromJSONValue(eObj);
test.equal(obj, roundTrip);
});

Tinytest.add("ejson - equality and falsiness", function (test) {
test.isTrue(EJSON.equals(null, null));
test.isTrue(EJSON.equals(undefined, undefined));
test.isFalse(EJSON.equals("foo", null));
test.isFalse(EJSON.equals(null, "foo"));
test.isFalse(EJSON.equals(undefined, "foo"));
test.isFalse(EJSON.equals("foo", undefined));
});

0 comments on commit bf81b0a

Please sign in to comment.