| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3dc3207 commit 5054fc7
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -423,12 +423,9 @@ By default, Node.js will run all files matching these patterns: | |||
| 423 | 423 | Unless [`--no-experimental-strip-types`][] is supplied, the following | |
| 424 | 424 | additional patterns are also matched: | |
| 425 | 425 | ||
| 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}` | ||
| 432 | 429 | ||
| 433 | 430 | Alternatively, one or more glob patterns can be provided as the | |
| 434 | 431 | final argument(s) to the Node.js command, as shown below. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -108,7 +108,7 @@ let kResistStopPropagation; | |||
| 108 | 108 | function createTestFileList(patterns, cwd) { | |
| 109 | 109 | const hasUserSuppliedPattern = patterns != null; | |
| 110 | 110 | if (!patterns || patterns.length === 0) { | |
| 111 | - patterns = [kDefaultPattern]; | ||
| 111 | + patterns = kDefaultPattern; | ||
| 112 | 112 | } | |
| 113 | 113 | const glob = new Glob(patterns, { | |
| 114 | 114 | __proto__: null, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,10 +55,10 @@ const kRegExpPattern = /^\/(.*)\/([a-z]*)$/; | |||
| 55 | 55 | ||
| 56 | 56 | const kPatterns = ['test', 'test/**/*', 'test-*', '*[._-]test']; | |
| 57 | 57 | const kFileExtensions = ['js', 'mjs', 'cjs']; | |
| 58 | + const kDefaultPattern = [`**/{${ArrayPrototypeJoin(kPatterns, ',')}}.{${ArrayPrototypeJoin(kFileExtensions, ',')}}`]; | ||
| 58 | 59 | if (getOptionValue('--experimental-strip-types')) { | |
| 59 | - ArrayPrototypePush(kFileExtensions, 'ts', 'mts', 'cts'); | ||
| 60 | + ArrayPrototypePush(kDefaultPattern, '**/test/**/*{-,.,_}test.{cts,mts,ts}'); | ||
| 60 | 61 | } | |
| 61 | - const kDefaultPattern = `**/{${ArrayPrototypeJoin(kPatterns, ',')}}.{${ArrayPrototypeJoin(kFileExtensions, ',')}}`; | ||
| 62 | 62 | ||
| 63 | 63 | function createDeferredCallback() { | |
| 64 | 64 | let calledCount = 0; | |
@@ -290,7 +290,7 @@ function parseCommandLine() { | |||
| 290 | 290 | if (!coverageExcludeGlobs || coverageExcludeGlobs.length === 0) { | |
| 291 | 291 | // TODO(pmarchini): this default should follow something similar to c8 defaults | |
| 292 | 292 | // Default exclusions should be also exported to be used by other tools / users | |
| 293 | - coverageExcludeGlobs = [kDefaultPattern]; | ||
| 293 | + coverageExcludeGlobs = kDefaultPattern; | ||
| 294 | 294 | } | |
| 295 | 295 | coverageIncludeGlobs = getOptionValue('--test-coverage-include'); | |
| 296 | 296 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments