node icon indicating copy to clipboard operation
node copied to clipboard

`--test` & `--test-reporter` & `--test-reporter-destination` will swallow error

Open himself65 opened this issue 10 months ago • 4 comments

Version

18,x 20.x, 22

Platform

macos

Subsystem

test_runner

What steps will reproduce the bug?

throw new Error('')

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

No response

What do you see instead?

node --test  ./index.js
// Error throw

node --test --test-reporter=lcov --test-reporter-destination=lcov.info  ./index.js
// nothing happened

Additional information

No response

himself65 avatar Apr 24 '24 19:04 himself65

This seems like expected behavior that is only specific to the lcov reporter, and has nothing to do with the reporter destination. This is because the lcov reporter's only functionality is to report code coverage information. It might be worth updating the lcov reporter docs to specify that:

  • No test results are reported by this reporter.
  • This reporter should ideally be used in conjunction with another reporter.

cjihrig avatar Apr 24 '24 21:04 cjihrig

You're wanting to see this update in here: https://github.com/nodejs/node/blob/7c3dce0e4f296d863a3f9e4cdbadaee8b0280f79/doc/api/test.md?plain=1#L503 ?

I can take this and open a PR if that's OK?

dfperry5 avatar Apr 29 '24 00:04 dfperry5

Thank you

himself65 avatar Apr 29 '24 00:04 himself65

@cjihrig, @himself65 can you check if my pull request it's ok about this issue https://github.com/nodejs/node/pull/52746

EliphazBouye avatar Apr 29 '24 09:04 EliphazBouye

is this issue this open ? can i work on it im a new guy

jsonOdison avatar May 15 '24 12:05 jsonOdison

The command to get console output AND coverage is quite long:

node --test \
  --test-reporter spec --test-reporter-destination stdout \
  --experimental-test-coverage --test-reporter lcov --test-reporter-destination lcov.info

phaux avatar Aug 03 '24 13:08 phaux

This was closed by https://github.com/nodejs/node/pull/53523.

cjihrig avatar Aug 13 '24 22:08 cjihrig