[Node v21] node --test executes tests twice if they are in folder named test #50875
Labels
confirmed-bug
Issues with confirmed bugs.
fs
Issues and PRs related to the fs subsystem / file system.
test_runner
Issues and PRs related to the test runner subsystem.
Version
21.2.0
Platform
Linux DEU1118 6.2.0-37-generic #38~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 2 18:01:13 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
Preparation
mkdir issue1
cd issue1
npm init
"type": "module"
. at the end it will look like thistest
sub-foldermkdir test
bug.test.js
in thetest
sub-folder with the following contentHow to Reproduce
execute from the main folder
node --test
the test will be executed twice. an example output:
How to "Fix"
rename your
test
folder to something else:mv test mest
execute again from the main folder
node --test
the test will be executed once. an example output:
How often does it reproduce? Is there a required condition?
It can be reproduced every single time
the required conditions are:
*.test.js
file(s) in a folder namedtest
node
21.*
What is the expected behavior? Why is that the expected behavior?
The expected behavior is the test to be executed once:
This is the expected behavior because I have one single test in one single file in the whole project
What do you see instead?
Test was executed twice:
Additional information
No response
The text was updated successfully, but these errors were encountered: