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

test/comment.js breaks #255

Closed
ronkorving opened this issue Feb 14, 2016 · 7 comments
Closed

test/comment.js breaks #255

ronkorving opened this issue Feb 14, 2016 · 7 comments
Assignees
Labels

Comments

@ronkorving
Copy link
Contributor

On OSX, Node.js 4.3.0 and 5.6.0

Output:

$ node test/comment.js 
TAP version 13
# no comment
ok 1 should be equal
# missing argument
ok 2 should be equal
not ok 3 should be equal
  ---
    file:   /Users/ronkorving/Projects/tape/test/comment.js
    line:   42
    column: 20
    stack:  
      - |
        getCaller (/Users/ronkorving/Projects/tape/node_modules/tap/lib/tap-assert.js:439:17)
      - |
        assert (/Users/ronkorving/Projects/tape/node_modules/tap/lib/tap-assert.js:21:16)
      - |
        Function.equal (/Users/ronkorving/Projects/tape/node_modules/tap/lib/tap-assert.js:163:10)
      - |
        Test._testAssert [as equal] (/Users/ronkorving/Projects/tape/node_modules/tap/lib/tap-test.js:87:16)
      - |
        Test.<anonymous> (/Users/ronkorving/Projects/tape/test/comment.js:42:20)
      - |
        Test.bound [as _cb] (/Users/ronkorving/Projects/tape/lib/test.js:62:32)
      - |
        Test.run (/Users/ronkorving/Projects/tape/lib/test.js:78:10)
      - |
        Test.bound [as run] (/Users/ronkorving/Projects/tape/lib/test.js:62:32)
      - |
        Immediate.next [as _onImmediate] (/Users/ronkorving/Projects/tape/lib/results.js:70:15)
      - |
        processImmediate [as _immediateCallback] (timers.js:383:17)
    found:  String.prototype.trim called on null or undefined
    wanted: Cannot call method on undefined
    diff:   |
      FOUND:  String.prototype.trim called on null or 
      WANTED: Cannot call method on undefined
              ^ (at position = 0)
  ...
# null argument
ok 4 should be equal
not ok 5 should be equal
  ---
    file:   /Users/ronkorving/Projects/tape/test/comment.js
    line:   60
    column: 20
    stack:  
      - |
        getCaller (/Users/ronkorving/Projects/tape/node_modules/tap/lib/tap-assert.js:439:17)
      - |
        assert (/Users/ronkorving/Projects/tape/node_modules/tap/lib/tap-assert.js:21:16)
      - |
        Function.equal (/Users/ronkorving/Projects/tape/node_modules/tap/lib/tap-assert.js:163:10)
      - |
        Test._testAssert [as equal] (/Users/ronkorving/Projects/tape/node_modules/tap/lib/tap-test.js:87:16)
      - |
        Test.<anonymous> (/Users/ronkorving/Projects/tape/test/comment.js:60:20)
      - |
        Test.bound [as _cb] (/Users/ronkorving/Projects/tape/lib/test.js:62:32)
      - |
        Test.run (/Users/ronkorving/Projects/tape/lib/test.js:78:10)
      - |
        Test.bound [as run] (/Users/ronkorving/Projects/tape/lib/test.js:62:32)
      - |
        Immediate.next [as _onImmediate] (/Users/ronkorving/Projects/tape/lib/results.js:70:15)
      - |
        processImmediate [as _immediateCallback] (timers.js:383:17)
    found:  String.prototype.trim called on null or undefined
    wanted: Cannot call method on null
    diff:   |
      FOUND:  String.prototype.trim called on null or 
      WANTED: Cannot call method on null
              ^ (at position = 0)
  ...
# whitespace
ok 6 should be equal
# non-string types
ok 7 should be equal
# multiline string
ok 8 should be equal

1..8
# tests 8
# pass  6
# fail  2
@ronkorving
Copy link
Contributor Author

It looks like this may be an easy fix, but I'm leaving the house soon so may not be able to contribute today.

@ljharb
Copy link
Collaborator

ljharb commented Feb 14, 2016

interesting, I couldn't reproduce this locally until i rm -rf node_modules && npm install - now I can.

@ljharb
Copy link
Collaborator

ljharb commented Feb 14, 2016

It looks like these are only failing on the error's message property, but not in any other way. I don't think we need to care about the specific error message here - I'll remove those assertions.

@ljharb ljharb closed this as completed in ba44de6 Feb 14, 2016
@ronkorving
Copy link
Contributor Author

I guess the trim dependency got an update recently that broke this then?

@ronkorving
Copy link
Contributor Author

In any case, thanks for fixing :)

@ljharb
Copy link
Collaborator

ljharb commented Feb 14, 2016

That seems to be the case, but assertions on error messages are inherently brittle anyways.

@ronkorving
Copy link
Contributor Author

Agreed

@ljharb ljharb added the bug label Feb 14, 2016
@ljharb ljharb self-assigned this Feb 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants