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

t.strictEqual on errors gives uninformative expected vs. actual #93

Closed
domenic opened this issue Jul 1, 2014 · 7 comments
Closed

t.strictEqual on errors gives uninformative expected vs. actual #93

domenic opened this issue Jul 1, 2014 · 7 comments

Comments

@domenic
Copy link
Collaborator

domenic commented Jul 1, 2014

E.g.

var e = new TypeError('boo!');
t.strictEqual(undefined, e);

gives

expected: {}
actual: undefined

whereas I would expect something like Node usually produces, i.e. [TypeError: boo!].

@ghost
Copy link

ghost commented Jul 1, 2014

So after investigation it looks like I can fix this upstream in https://www.npmjs.org/package/object-inspect

Thanks for raising the issue! I'll get on this when I get unbusy from nodeconf prep.

@domenic
Copy link
Collaborator Author

domenic commented Aug 4, 2014

Bump :)

@ghost
Copy link

ghost commented Aug 5, 2014

Fixed in 2.14.0 and fixed in object-inspect in 1.0.0 (including 100% test coverage).

@ghost ghost closed this as completed Aug 5, 2014
@ghost
Copy link

ghost commented Aug 5, 2014

input:

var test = require('tape');

test(function (t) {
    var e = new TypeError('boo!');
    t.strictEqual(undefined, e);
});

output:

$ node x.js
TAP version 13
# (anonymous)
not ok 1 should be equal
  ---
    operator: equal
    expected: [TypeError: boo!]
    actual:   undefined
  ...
not ok 2 test exited without ending
  ---
    operator: fail
  ...

1..2
# tests 2
# pass  0
# fail  2

@domenic
Copy link
Collaborator Author

domenic commented Aug 5, 2014

<3 <3 <3

@domenic
Copy link
Collaborator Author

domenic commented Mar 12, 2015

Hmm object-inspect is still not updated. I could swear I saw this working for a while but now it doesn't... any ideas?

@domenic
Copy link
Collaborator Author

domenic commented Mar 30, 2015

Woah, there was a 2.14.0 release that had this fixed but then it got ... removed from master? https://github.com/substack/tape/commits/2.14.0

@domenic domenic reopened this Apr 2, 2015
domenic added a commit that referenced this issue Apr 2, 2015
@domenic domenic closed this as completed in d6acc1e Apr 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant