node
node copied to clipboard
`--test` & `--test-reporter` & `--test-reporter-destination` will swallow error
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
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.
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?
Thank you
@cjihrig, @himself65 can you check if my pull request it's ok about this issue https://github.com/nodejs/node/pull/52746
is this issue this open ? can i work on it im a new guy
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
This was closed by https://github.com/nodejs/node/pull/53523.