-
I noticed that if any tested code prints to std out with the base reporter, it shows up in the console, but is then later suppressed once the test results are available. Switching to raw tap output preserves the output in the console, but then you lose a lot of the other nice things about the base reporter. I was wondering if there was a way to run the base reporter, but preserve the output generated by the tested code. |
Beta Was this translation helpful? Give feedback.
Answered by
isaacs
May 31, 2024
Replies: 1 comment 5 replies
-
Do you have an example? This seems to work fine for me: import t from 'tap'
t.pass('this is fine')
console.log('this is not tap output')
t.pass('this is also fine')
|
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's because
# this is not displayed
is a valid TAP comment.The Test Anything Protocol works by having child processes that emit data in the protocol on standard output.
If the data on stdout is not valid TAP then it is shown to the user, but all a TAP subtest actually does is emit TAP on stdout, so if your program emits TAP on stdout, well, that's going to be parsed and consumed by the runner.
For example: