Repository navigation
node --test does not show skipped tests in TAP result #45833
Description
Activity
- addedtest_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
on Dec 13, 2022 When you run with
--test, each test file is run separately and their outputs are combined into a single TAP document. That's why the test count in the summary matches the number of test files run.Since Node v19.2.0, the output is combined more intelligently. Now that we have the other pieces in place, I think we should go a step further now and remove the separation by test file in the output. In other words, if file 1 had 3 top level tests, and file 2 had 4 top level tests, then the output from
--testwould have 7 top level tests instead of 2 as it currently does.Reacted by Moshe Atlow, Denis Zelikson and Toni VillenaBut what about the case when I have only one file? The result is the same - all tests passed and no information about skipped tests. Does it mean that
node --testcombine result into TAP even if there is only one test file?What I'm proposing in #45833 (comment) would apply to the case where there is a single file. The summary printed at the end of a run only applies to top level tests. If you run without
--test, the top level is all of the top leveltest()calls in the file. If you run with--test, the top level is currently the collection of files (even if there is only one). I'm proposing we change the behavior with--test.I think you already realize this based on your original bug report, but if you only have one file, then as a workaround for now, you can run without
--test.Reacted by Denis Zeliksoncc @manekinekko in case you have any interest in working on this ^ - I think the changes would be confined to the CLI runner and parser.
- added a commit that references this issue
on Feb 18, 2023 - added 2 commits that reference this issue
on Mar 3, 2023 - added 2 commits that reference this issue
on Mar 13, 2023
Version
v18.12.1
Platform
Darwin Kernel Version 22.1.0 root:xnu-8792.41.9~2/RELEASE_ARM64_T8103 arm64
Subsystem
node:test
What steps will reproduce the bug?
In my project I have a folder named 'test' with two files inside.
The first file (Unit one) contains describe and test with different variations of skip. All the asserts are intentionally failed.
The second file contains describe and test with correct asserts (Unit two).
Additionally, if I have the only file with combination of both skipped and ordinary describe and test (Unit three). This file was run separately.
How often does it reproduce? Is there a required condition?
Every time when I use
node --testWhat is the expected behavior?
When I run
node --test, I expect to see information about skipped tests in the final TAP result.What do you see instead?
When I run
node --testwith 'test' folder, contains of the first and the second files, there are no skipped tests.When I run the third file alone I have the same result without skipped tests as well
Additional information
On the contrary, if I run
node test/one.mjsI have correct TAP result with information about skipped tests.As well as I run
node test/three.mjs