GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test_runner: detect only tests when isolation is off · nodejs/node@3396a49

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • cli.md
    • test.md
  • lib/internal/test_runner
    • harness.js
  • test/parallel
    • test-runner-no-isolation-filtering.js
    • test-runner-no-isolation-hooks.mjs
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/cli.md‎

Copy file name to clipboardExpand all lines: doc/api/cli.md
+1-1Lines changed: 1 addition & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -2334,7 +2334,7 @@ changes:
23342334
-->
23352335

23362336
Configures the test runner to only execute top level tests that have the `only`
2337-
option set.
2337+
option set. This flag is not necessary when test isolation is disabled.
23382338

23392339
### `--test-reporter`
23402340

Collapse file

‎doc/api/test.md‎

Copy file name to clipboardExpand all lines: doc/api/test.md
+4-4Lines changed: 4 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -229,10 +229,10 @@ const { describe, it } = require('node:test');
229229

230230
## `only` tests
231231

232-
If Node.js is started with the [`--test-only`][] command-line option, it is
233-
possible to skip all tests except for a selected subset by passing
234-
the `only` option to the tests that should run. When a test with the `only`
235-
option is set, all subtests are also run.
232+
If Node.js is started with the [`--test-only`][] command-line option, or test
233+
isolation is disabled, it is possible to skip all tests except for a selected
234+
subset by passing the `only` option to the tests that should run. When a test
235+
with the `only` option is set, all subtests are also run.
236236
If a suite has the `only` option set, all tests within the suite are run,
237237
unless it has descendants with the `only` option set, in which case only those
238238
tests are run.
Collapse file

‎lib/internal/test_runner/harness.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/harness.js
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ function createTestTree(rootTestOptions, globalOptions) {
3838
const buildPhaseDeferred = createDeferredPromise();
3939
const isFilteringByName = globalOptions.testNamePatterns ||
4040
globalOptions.testSkipPatterns;
41-
const isFilteringByOnly = globalOptions.only;
41+
const isFilteringByOnly = globalOptions.only || (globalOptions.isTestRunner &&
42+
globalOptions.isolation === 'none');
4243
const harness = {
4344
__proto__: null,
4445
buildPromise: buildPhaseDeferred.promise,
Collapse file

‎test/parallel/test-runner-no-isolation-filtering.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-runner-no-isolation-filtering.js
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,8 @@ test('works with --test-name-pattern', () => {
4545

4646
assert.strictEqual(child.status, 0);
4747
assert.strictEqual(child.signal, null);
48-
assert.match(stdout, /# tests 1/);
48+
assert.match(stdout, /# tests 0/);
4949
assert.match(stdout, /# suites 0/);
50-
assert.match(stdout, /# pass 1/);
51-
assert.match(stdout, /ok 1 - test one/);
5250
});
5351

5452
test('works with --test-skip-pattern', () => {
Collapse file

‎test/parallel/test-runner-no-isolation-hooks.mjs‎

Copy file name to clipboardExpand all lines: test/parallel/test-runner-no-isolation-hooks.mjs
-9Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ const order = [
3131
'afterEach one: suite one - test',
3232
'afterEach two: suite one - test',
3333

34-
'beforeEach(): global',
35-
'beforeEach one: test one',
36-
'beforeEach two: test one',
37-
'test one',
38-
39-
'afterEach(): global',
40-
'afterEach one: test one',
41-
'afterEach two: test one',
42-
4334
'before suite two: suite two',
4435
'beforeEach(): global',
4536
'beforeEach one: suite two - test',

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.