Commit 6552fdd
test_runner: update kPatterns
PR-URL: #54728
Fixes: #54726
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jake Yuesong Li <jake.yuesong@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Moshe Atlow <moshe@atlow.co.il>1 parent 7a1d633 commit 6552fdd
File tree
7 files changed
+48
-1
lines changed- lib/internal/test_runner
- test
- fixtures/test-runner
- issue-54726
- matching-patterns
- parallel
7 files changed
+48
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
Whitespace-only changes.
Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
@@ -43,6 +43,22 @@ for (const isolation of ['none', 'process']) {4343 assert.match(stdout, /ok 6 - this should be executed/);4444 }4545
46+ {47+ // Should match files with "-test.(c|m)js" suffix.48+ const args = ['--test', '--test-reporter=tap',49+ `--experimental-test-isolation=${isolation}`];50+ const child = spawnSync(process.execPath, args, { cwd: join(testFixtures, 'matching-patterns') });51+52+ assert.strictEqual(child.status, 0);53+ assert.strictEqual(child.signal, null);54+ assert.strictEqual(child.stderr.toString(), '');55+ const stdout = child.stdout.toString();56+57+ assert.match(stdout, /ok 1 - this should pass/);58+ assert.match(stdout, /ok 2 - this should pass/);59+ assert.match(stdout, /ok 3 - this should pass/);60+ }61+4662 {4763 // Same but with a prototype mutation in require scripts.4864 const args = [@@ -361,3 +377,22 @@ for (const isolation of ['none', 'process']) {361377 assert.match(stdout, /# fail 0/);362378 assert.match(stdout, /# skipped 0/);363379}380+381+{382+ // Should not match files like latest.js383+ const args = ['--test', '--test-reporter=tap'];384+ const child = spawnSync(process.execPath, args, { cwd: join(testFixtures, 'issue-54726') });385+386+ assert.strictEqual(child.status, 0);387+ assert.strictEqual(child.signal, null);388+ assert.strictEqual(child.stderr.toString(), '');389+ const stdout = child.stdout.toString();390+391+ assert.match(stdout, /tests 0/);392+ assert.match(stdout, /suites 0/);393+ assert.match(stdout, /pass 0/);394+ assert.match(stdout, /fail 0/);395+ assert.match(stdout, /cancelled 0/);396+ assert.match(stdout, /skipped 0/);397+ assert.match(stdout, /todo 0/);398+}
0 commit comments