-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
test_runner: add --test-skip-pattern cli option #52529
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5321337
test_runner: add --test-skip-pattern cli option
avivkeller 7e9b56f
Update cli.md
avivkeller 69a62ec
Update test.md
avivkeller e705f46
Update test.js
avivkeller c36c70b
Update test.js
avivkeller 51138ac
Update test.js
avivkeller File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 * |
avivkeller marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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 | ||
avivkeller marked this conversation as resolved.
Show resolved
Hide resolved
|
||
'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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.