-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test_runner: add --test-skip-pattern cli option
PR-URL: #52529 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]>
- Loading branch information
1 parent
c8c6173
commit e247a61
Showing
13 changed files
with
185 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
test/fixtures/test-runner/output/name_and_skip_patterns.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Flags: --test-skip-pattern=disabled --test-name-pattern=enabled | ||
'use strict'; | ||
const common = require('../../../common'); | ||
const { | ||
test, | ||
} = require('node:test'); | ||
|
||
test('disabled', common.mustNotCall()); | ||
test('enabled', common.mustCall()); | ||
test('enabled disabled', common.mustNotCall()); |
15 changes: 15 additions & 0 deletions
15
test/fixtures/test-runner/output/name_and_skip_patterns.snapshot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
TAP version 13 | ||
# Subtest: enabled | ||
ok 1 - enabled | ||
--- | ||
duration_ms: * | ||
... | ||
1..1 | ||
# tests 1 | ||
# suites 0 | ||
# pass 1 | ||
# fail 0 | ||
# cancelled 0 | ||
# skipped 0 | ||
# todo 0 | ||
# duration_ms * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// Flags: --test-skip-pattern=disabled --test-skip-pattern=/no/i | ||
'use strict'; | ||
const common = require('../../../common'); | ||
const { | ||
describe, | ||
it, | ||
test, | ||
} = require('node:test'); | ||
|
||
test('top level test disabled', common.mustNotCall()); | ||
test('top level skipped test disabled', { skip: true }, common.mustNotCall()); | ||
test('top level skipped test enabled', { skip: true }, common.mustNotCall()); | ||
it('top level it enabled', common.mustCall()); | ||
it('top level it disabled', common.mustNotCall()); | ||
it.skip('top level skipped it disabled', common.mustNotCall()); | ||
it.skip('top level skipped it enabled', common.mustNotCall()); | ||
describe('top level describe', common.mustCall()); | ||
describe.skip('top level skipped describe disabled', common.mustNotCall()); | ||
describe.skip('top level skipped describe enabled', common.mustNotCall()); | ||
test('this will NOt call', common.mustNotCall()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
TAP version 13 | ||
# Subtest: top level skipped test enabled | ||
ok 1 - top level skipped test enabled # SKIP | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: top level it enabled | ||
ok 2 - top level it enabled | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: top level skipped it enabled | ||
ok 3 - top level skipped it enabled # SKIP | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: top level describe | ||
ok 4 - top level describe | ||
--- | ||
duration_ms: * | ||
type: 'suite' | ||
... | ||
# Subtest: top level skipped describe enabled | ||
ok 5 - top level skipped describe enabled # SKIP | ||
--- | ||
duration_ms: * | ||
type: 'suite' | ||
... | ||
1..5 | ||
# tests 3 | ||
# suites 2 | ||
# pass 1 | ||
# fail 0 | ||
# cancelled 0 | ||
# skipped 2 | ||
# todo 0 | ||
# duration_ms * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters