-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Test runner matching every .ts and .js if glob is not provided #56546
Comments
It matches the files because they are under a |
As correctly pointed out by @targos, this behaviour is intended. IMHO, it is common to have test helpers/fixtures under the test directory. |
Mocha also checks for a |
I think executing only |
I agree that a huge breaking change. But I'm also convinced that |
Version
Test on v23.6.0 and v22.10.0
Platform
Subsystem
test_runner
What steps will reproduce the bug?
Consider this folder structure:
When running
node --test
the test runner will execute./test/fixtures/boom.js
.In v23 it will also execute
./test/fixtures/boom.ts
, since--experimental-strip-types
has been unflagged.Error: boom
at Object. (/Users/marcoippolito/Documents/projects/test/test/fixtures/boom.js:1:7)
at Module._compile (node:internal/modules/cjs/loader:1739:14)
at Object..js (node:internal/modules/cjs/loader:1904:10)
at Module.load (node:internal/modules/cjs/loader:1473:32)
at Function._load (node:internal/modules/cjs/loader:1285:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:151:5)
at node:internal/main/run_main_module:33:47
Node.js v23.6.0
✖ test/fixtures/boom.js (36.07275ms)
'test failed'
/Users/marcoippolito/Documents/projects/test/test/fixtures/boom.ts:1
throw new Error('boom TS');
^
Error: boom TS
at Object. (/Users/marcoippolito/Documents/projects/test/test/fixtures/boom.ts:1:7)
at Module._compile (node:internal/modules/cjs/loader:1739:14)
at Object.loadTS [as .ts] (node:internal/modules/cjs/loader:1831:10)
at Module.load (node:internal/modules/cjs/loader:1473:32)
at Function._load (node:internal/modules/cjs/loader:1285:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:234:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:151:5)
at node:internal/main/run_main_module:33:47
Node.js v23.6.0
✖ test/fixtures/boom.ts (62.136209ms)
'test failed'
✔ should return true (0.3725ms)
ℹ tests 3
ℹ suites 0
ℹ pass 1
ℹ fail 2
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 72.075583
✖ failing tests:
test at test/fixtures/boom.js:1:1
✖ test/fixtures/boom.js (36.07275ms)
'test failed'
test at test/fixtures/boom.ts:1:1
✖ test/fixtures/boom.ts (62.136209ms)
'test failed'
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior? Why is that the expected behavior?
Maybe this is intended behavior but I'd would expect matching
.test.js
.I think it's an undesired side effect to execute everything.
I immagine breakages due to a lot of
.ts
fixtures being executed.What do you see instead?
Everything is executed.
Additional information
I know changing this would be a breaking change, but I dont think it's sane as it is.
The text was updated successfully, but these errors were encountered: