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: change ts default glob · nodejs/node@5054fc7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc/api
    • test.md
  • lib/internal/test_runner
    • runner.js
    • utils.js
  • test/fixtures/test-runner/matching-patterns/test
    • typescript-test.cts
    • typescript-test.mts
    • typescript-test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api/test.md‎

Copy file name to clipboardExpand all lines: doc/api/test.md
+3-6Lines changed: 3 additions & 6 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -423,12 +423,9 @@ By default, Node.js will run all files matching these patterns:
423423
Unless [`--no-experimental-strip-types`][] is supplied, the following
424424
additional patterns are also matched:
425425

426-
* `**/*.test.{cts,mts,ts}`
427-
* `**/*-test.{cts,mts,ts}`
428-
* `**/*_test.{cts,mts,ts}`
429-
* `**/test-*.{cts,mts,ts}`
430-
* `**/test.{cts,mts,ts}`
431-
* `**/test/**/*.{cts,mts,ts}`
426+
* `**/test/**/*-test.{cts,mts,ts}`
427+
* `**/test/**/*.test.{cts,mts,ts}`
428+
* `**/test/**/*_test.{cts,mts,ts}`
432429

433430
Alternatively, one or more glob patterns can be provided as the
434431
final argument(s) to the Node.js command, as shown below.
Collapse file

‎lib/internal/test_runner/runner.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/runner.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ let kResistStopPropagation;
108108
function createTestFileList(patterns, cwd) {
109109
const hasUserSuppliedPattern = patterns != null;
110110
if (!patterns || patterns.length === 0) {
111-
patterns = [kDefaultPattern];
111+
patterns = kDefaultPattern;
112112
}
113113
const glob = new Glob(patterns, {
114114
__proto__: null,
Collapse file

‎lib/internal/test_runner/utils.js‎

Copy file name to clipboardExpand all lines: lib/internal/test_runner/utils.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ const kRegExpPattern = /^\/(.*)\/([a-z]*)$/;
5555

5656
const kPatterns = ['test', 'test/**/*', 'test-*', '*[._-]test'];
5757
const kFileExtensions = ['js', 'mjs', 'cjs'];
58+
const kDefaultPattern = [`**/{${ArrayPrototypeJoin(kPatterns, ',')}}.{${ArrayPrototypeJoin(kFileExtensions, ',')}}`];
5859
if (getOptionValue('--experimental-strip-types')) {
59-
ArrayPrototypePush(kFileExtensions, 'ts', 'mts', 'cts');
60+
ArrayPrototypePush(kDefaultPattern, '**/test/**/*{-,.,_}test.{cts,mts,ts}');
6061
}
61-
const kDefaultPattern = `**/{${ArrayPrototypeJoin(kPatterns, ',')}}.{${ArrayPrototypeJoin(kFileExtensions, ',')}}`;
6262

6363
function createDeferredCallback() {
6464
let calledCount = 0;
@@ -290,7 +290,7 @@ function parseCommandLine() {
290290
if (!coverageExcludeGlobs || coverageExcludeGlobs.length === 0) {
291291
// TODO(pmarchini): this default should follow something similar to c8 defaults
292292
// Default exclusions should be also exported to be used by other tools / users
293-
coverageExcludeGlobs = [kDefaultPattern];
293+
coverageExcludeGlobs = kDefaultPattern;
294294
}
295295
coverageIncludeGlobs = getOptionValue('--test-coverage-include');
296296

Collapse file

‎…er/matching-patterns/typescript-test.cts‎ ‎…tching-patterns/test/typescript-test.cts‎test/fixtures/test-runner/matching-patterns/typescript-test.cts renamed to test/fixtures/test-runner/matching-patterns/test/typescript-test.cts test/fixtures/test-runner/matching-patterns/typescript-test.cts renamed to test/fixtures/test-runner/matching-patterns/test/typescript-test.cts

Copy file name to clipboard
File renamed without changes.
Collapse file

‎…er/matching-patterns/typescript-test.mts‎ ‎…tching-patterns/test/typescript-test.mts‎test/fixtures/test-runner/matching-patterns/typescript-test.mts renamed to test/fixtures/test-runner/matching-patterns/test/typescript-test.mts test/fixtures/test-runner/matching-patterns/typescript-test.mts renamed to test/fixtures/test-runner/matching-patterns/test/typescript-test.mts

Copy file name to clipboard
File renamed without changes.
Collapse file

‎…ner/matching-patterns/typescript-test.ts‎ ‎…atching-patterns/test/typescript-test.ts‎test/fixtures/test-runner/matching-patterns/typescript-test.ts renamed to test/fixtures/test-runner/matching-patterns/test/typescript-test.ts test/fixtures/test-runner/matching-patterns/typescript-test.ts renamed to test/fixtures/test-runner/matching-patterns/test/typescript-test.ts

Copy file name to clipboard
File renamed without changes.

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.