scottcorgan / tap-out

A different tap parser
MIT License
23 stars 28 forks source link

parse mocha tap output errors? #13

Closed jprichardson closed 9 years ago

jprichardson commented 9 years ago

So we know tape output errors like this:

not ok 4 1 !== 2
  ---
    operator: equal
    expected: 2
    actual:   1
    at: Test.<anonymous> (/Users/jp/workspace/code/atom-trinity/test/test.js:16:5)
  ...

Would you be willing to modify tap-out so that it can catch Mocha tap errors as well?

not ok 1 some module description someMethod() should do something
  AssertionError: 1 == 2
      at Context.<anonymous> (test/mocha-test.js:11:14)

I don't think it'd need to be as sophisticated enough to convert to the tape error object that you have already, but if it included the mocha output in the assertion.error.raw field, that'd be super helpful.

Thanks!

jprichardson commented 9 years ago

Bump :)

Raynos commented 9 years ago

:-1:

Mocha should respect the TAP specification.

jprichardson commented 9 years ago

Mocha should respect the TAP specification.

Oh sorry, I wasn't aware that Mocha wasn't following the TAP specification. I looked over https://testanything.org/tap-specification.html and I didn't see anything related to errors / error outputs indicating that Mocha wasn't correctly following the spec. So I'm not sure how Mocha is violating the spec. Would you mind pointing it out? Thanks.

Raynos commented 9 years ago

@jprichardson

Check out the TAP 13 spec ( https://testanything.org/tap-version-13-specification.html ). It mentions that error diagnosis should be yaml blocks.

jprichardson commented 9 years ago

Oh wow. Thanks for pointing that out @Raynos, I had no idea! To be fair to Mocha, it doesn't specify which TAP version, but there's no reason that Mocha shouldn't comply with TAP version 13. I'll bring the issue over there :)