-
Notifications
You must be signed in to change notification settings - Fork 29.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// Flags: --no-warnings --test-only --test-name-pattern=enabled | ||
'use strict'; | ||
const common = require('../common'); | ||
const { test } = require('node:test'); | ||
|
||
test('enabled and only', { only: true }, common.mustCall(async (t) => { | ||
await t.test('enabled', common.mustCall()); | ||
await t.test('disabled', common.mustNotCall()); | ||
})); | ||
|
||
test('enabled but not only', common.mustNotCall()); | ||
test('only does not match pattern', { only: true }, common.mustNotCall()); | ||
test('not only and does not match pattern', 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,40 @@ | ||
TAP version 13 | ||
# Subtest: enabled and only | ||
# Subtest: enabled | ||
ok 1 - enabled | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: disabled | ||
ok 2 - disabled # SKIP test name does not match pattern | ||
--- | ||
duration_ms: * | ||
... | ||
1..2 | ||
ok 1 - enabled and only | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: enabled but not only | ||
ok 2 - enabled but not only # SKIP 'only' option not set | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: only does not match pattern | ||
ok 3 - only does not match pattern # SKIP test name does not match pattern | ||
--- | ||
duration_ms: * | ||
... | ||
# Subtest: not only and does not match pattern | ||
ok 4 - not only and does not match pattern # SKIP 'only' option not set | ||
--- | ||
duration_ms: * | ||
... | ||
1..4 | ||
# tests 4 | ||
# pass 1 | ||
# fail 0 | ||
# cancelled 0 | ||
# skipped 3 | ||
# todo 0 | ||
# duration_ms * |