avajs / babel

Babel provider for AVA.
11 stars 3 forks source link

-t doesn't display power-assert output #28

Closed retrohacker closed 4 years ago

retrohacker commented 4 years ago

Please provide details about:

Use tape output with power-assert

When the -t flag is provided, I get what looks like a standard error object

Get the power-assert output in the tape formatted results

Repro: https://gist.github.com/retrohacker/973ddd4d50383c27c75fa6572cab7e5d

Output:

$ npm run test

> @ test /home/retrohacker/Development/ava-repro
> ava; ava -t

  ✖ Should render power-assert rendering power-assert
  ─

  Should render power-assert

  index.test.js:6

   5:   const x = [1,2,3]                                   
   6:   t.assert(x.length > three, 'rendering power-assert')
   7: })                                                    

  rendering power-assert

  Value is not truthy:

  false

  x.length > three
  => false

  three
  => 3

  x.length
  => 3

  x
  => [
    1,
    2,
    3,
  ]

  › index.test.js:6:5

  ─

  1 test failed
TAP version 13
# Should render power-assert
not ok 1 - Should render power-assert
  ---
    name: AssertionError
    message: rendering power-assert
    assertion: assert
    operator: '!!'
    values:
      'Value is not truthy:': 'false'
    at: 'index.test.js:6:5'
  ...

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

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ test: `ava; ava -t`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @ test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/retrohacker/.npm/_logs/2020-07-21T20_17_20_706Z-debug.log
novemberborn commented 4 years ago

The TAP reporter does not have full fidelity with the regular reporter, unfortunately. That code lives at https://github.com/avajs/ava/blob/master/lib/reporters/tap.js and while we would take a PR, it's not a priority otherwise.

(I'm closing this issue for housekeeping purposes, but let's keep the conversation going.)