isaacs/node-tap — Issue #13: Using t.equal on two similar objects produces confusing output
Author: ashb
Created: 2011-10-20 22:20:21+00:00
State: open

I mistakenly used `t.equal( output, json )` and the output it produced was unhelpful in working out what I did wrong

not ok 1
---
file: /Users/ash/code/js/markdown-js/test/features.t.js
line: 53
column: 17
stack:
- getCaller (/Users/ash/code/js/markdown-js/node_modules/tap/node_modules/tap-assert/assert.js:369:17)
- assert (/Users/ash/code/js/markdown-js/node_modules/tap/node_modules/tap-assert/assert.js:17:16)
- Function.equal (/Users/ash/code/js/markdown-js/node_modules/tap/node_modules/tap-assert/assert.js:158:10)
- Test._testAssert [as equal] (/Users/ash/code/js/markdown-js/node_modules/tap/node_modules/tap-test/test.js:86:16)
- Test. (/Users/ash/code/js/markdown-js/test/features.t.js:53:17)
- Test. (native)
- Test. (events.js:61:17)
- Test.emit (/Users/ash/code/js/markdown-js/node_modules/tap/node_modules/tap-test/test.js:102:8)
- GlobalHarness. (/Users/ash/code/js/markdown-js/node_modules/tap/node_modules/tap-harness/harness.js:86:13)
- Array.0 (native)
found:
- html
-
- blockquote
-
- p
- There's a code block in here:
-
- pre
-
- code
- |
SET foo = TRUE

IF foo GOTO 10
-
- p
- Wasn't that nice?
wanted:
- html
-
- blockquote
-
- p
- There's a code block in here:
-
- pre
-
- code
- |
SET foo = TRUE

IF foo GOTO 10
-
- p
- Wasn't that nice?
diff: ~
unique: 0

The main issue here is `diff: ~`. Having some message saying that the objects are similar but different references/ids might hlep?