Permalink
Browse files

fix buggy stringify() key ordering hack by using deep-equal module in…

…stead since difflet does the diffs anyways now
  • Loading branch information...
1 parent af67811 commit 93d46ecc62ae39ccb83efc962b4c6c7a6b2a02cd @substack substack committed with isaacs Feb 22, 2012
Showing with 5 additions and 3 deletions.
  1. +3 −2 lib/tap-assert.js
  2. +2 −1 package.json
View
@@ -1,5 +1,6 @@
// an assert module that returns tappable data for each assertion.
var difflet = require('difflet')
+ , deepEqual = require('deep-equal')
module.exports = assert
@@ -172,7 +173,7 @@ function equivalent (a, b, message, extra) {
message = message || "should be equivalent"
extra.found = a
extra.wanted = b
- return assert(stringify(a) === stringify(b), message, extra)
+ return assert(deepEqual(a, b), message, extra)
}
assert.equivalent = equivalent
syns.equivalent = ["isEquivalent"
@@ -208,7 +209,7 @@ function inequivalent (a, b, message, extra) {
message = message || "should not be equivalent"
extra.found = a
extra.doNotWant = b
- return assert(stringify(a) !== stringify(b), message, extra)
+ return assert(!deepEqual(a, b), message, extra)
}
assert.inequivalent = inequivalent
syns.inequivalent = ["notEquivalent"
View
@@ -12,7 +12,8 @@
"runforcover": "~0.0.2",
"nopt": "~1.0.10",
"mkdirp": "~0.2.2",
- "difflet" : "0.2.0"
+ "difflet" : "0.2.0",
+ "deep-equal" : "~0.0.0"
},
"bundledDependencies": [
"inherits",

0 comments on commit 93d46ec

Please sign in to comment.