Closed
Description
Version
18.4.0
Platform
Linux pop-os 5.17.15-76051715-generic #202206141358165591911622.04~1db9e34 SMP PREEMPT Wed Jun 22 19 x86_64 x86_64 x86_64 GNU/Linux
Subsystem
No response
What steps will reproduce the bug?
- Create a new project via
npm init -y
- Change the test script to
"test": "node --test ./myTestDir/**/*Tests.js"
- Create the following folder structure
.
├── myTestDir
│ └── aFolder
│ ├── aSubFolder
│ │ └── ignoredTests.js
│ └── pickedUpTests.js
└── package.json
pickedUpTests.js
const assert = require('assert/strict');
const test = require('node:test');
test('picked up by testrunner', async t => {
await t.test('passes.', async () => {
assert.ok(true);
});
});
ignoredTests.js
const assert = require('assert/strict');
const test = require('node:test');
test('ignored by testrunner', async t => {
await t.test('fails.', async () => {
assert.ok(false);
});
});
- When running
npm run test
only pickedUpTests run
How often does it reproduce? Is there a required condition?
Always
What is the expected behavior?
It should run all tests ( failing ones too )
What do you see instead?
It seems the glob parsing is broken so it only runs tests on a specific directory depth
Additional information
A temporary workaround for this would be the glob ./myTestDir/**/**/*Tests.js