diff --git a/test/fixtures/test-runner/matching-patterns/index-test.cjs b/test/fixtures/test-runner/matching-patterns/index-test.cjs new file mode 100644 index 000000000000000..2a722c504b9fa5e --- /dev/null +++ b/test/fixtures/test-runner/matching-patterns/index-test.cjs @@ -0,0 +1,4 @@ +'use strict'; +const test = require('node:test'); + +test('this should pass'); diff --git a/test/fixtures/test-runner/matching-patterns/index-test.js b/test/fixtures/test-runner/matching-patterns/index-test.js new file mode 100644 index 000000000000000..2a722c504b9fa5e --- /dev/null +++ b/test/fixtures/test-runner/matching-patterns/index-test.js @@ -0,0 +1,4 @@ +'use strict'; +const test = require('node:test'); + +test('this should pass'); diff --git a/test/fixtures/test-runner/matching-patterns/index-test.mjs b/test/fixtures/test-runner/matching-patterns/index-test.mjs new file mode 100644 index 000000000000000..49290287eb348cb --- /dev/null +++ b/test/fixtures/test-runner/matching-patterns/index-test.mjs @@ -0,0 +1,4 @@ +'use strict'; +import test from 'node:test'; + +test('this should pass'); diff --git a/test/parallel/test-runner-cli.js b/test/parallel/test-runner-cli.js index a1e3e2d85554e44..490893b671d9c35 100644 --- a/test/parallel/test-runner-cli.js +++ b/test/parallel/test-runner-cli.js @@ -43,6 +43,22 @@ for (const isolation of ['none', 'process']) { assert.match(stdout, /ok 6 - this should be executed/); } + { + // Should match files with "-test.(c|m)js" suffix. + const args = ['--test', '--test-reporter=tap', + `--experimental-test-isolation=${isolation}`]; + const child = spawnSync(process.execPath, args, { cwd: join(testFixtures, 'matching-patterns') }); + + assert.strictEqual(child.status, 0); + assert.strictEqual(child.signal, null); + assert.strictEqual(child.stderr.toString(), ''); + const stdout = child.stdout.toString(); + + assert.match(stdout, /ok 1 - this should pass/); + assert.match(stdout, /ok 2 - this should pass/); + assert.match(stdout, /ok 3 - this should pass/); + } + { // Same but with a prototype mutation in require scripts. const args = [