| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9ca4b46 commit f7041b9
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -472,9 +472,12 @@ By default, Node.js will run all files matching these patterns: | |||
| 472 | 472 | Unless [`--no-experimental-strip-types`][] is supplied, the following | |
| 473 | 473 | additional patterns are also matched: | |
| 474 | 474 | ||
| 475 | - * `**/test/**/*-test.{cts,mts,ts}` | ||
| 476 | - * `**/test/**/*.test.{cts,mts,ts}` | ||
| 477 | - * `**/test/**/*_test.{cts,mts,ts}` | ||
| 475 | + * `**/*.test.{cts,mts,ts}` | ||
| 476 | + * `**/*-test.{cts,mts,ts}` | ||
| 477 | + * `**/*_test.{cts,mts,ts}` | ||
| 478 | + * `**/test-*.{cts,mts,ts}` | ||
| 479 | + * `**/test.{cts,mts,ts}` | ||
| 480 | + * `**/test/**/*.{cts,mts,ts}` | ||
| 478 | 481 | ||
| 479 | 482 | Alternatively, one or more glob patterns can be provided as the | |
| 480 | 483 | final argument(s) to the Node.js command, as shown below. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -110,7 +110,7 @@ let kResistStopPropagation; | |||
| 110 | 110 | function createTestFileList(patterns, cwd) { | |
| 111 | 111 | const hasUserSuppliedPattern = patterns != null; | |
| 112 | 112 | if (!patterns || patterns.length === 0) { | |
| 113 | - patterns = kDefaultPattern; | ||
| 113 | + patterns = [kDefaultPattern]; | ||
| 114 | 114 | } | |
| 115 | 115 | const glob = new Glob(patterns, { | |
| 116 | 116 | __proto__: null, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -60,10 +60,10 @@ const kRegExpPattern = /^\/(.*)\/([a-z]*)$/; | |||
| 60 | 60 | ||
| 61 | 61 | const kPatterns = ['test', 'test/**/*', 'test-*', '*[._-]test']; | |
| 62 | 62 | const kFileExtensions = ['js', 'mjs', 'cjs']; | |
| 63 | - const kDefaultPattern = [`**/{${ArrayPrototypeJoin(kPatterns, ',')}}.{${ArrayPrototypeJoin(kFileExtensions, ',')}}`]; | ||
| 64 | 63 | if (getOptionValue('--experimental-strip-types')) { | |
| 65 | - ArrayPrototypePush(kDefaultPattern, '**/test/**/*{-,.,_}test.{cts,mts,ts}'); | ||
| 64 | + ArrayPrototypePush(kFileExtensions, 'ts', 'mts', 'cts'); | ||
| 66 | 65 | } | |
| 66 | + const kDefaultPattern = `**/{${ArrayPrototypeJoin(kPatterns, ',')}}.{${ArrayPrototypeJoin(kFileExtensions, ',')}}`; | ||
| 67 | 67 | ||
| 68 | 68 | function createDeferredCallback() { | |
| 69 | 69 | let calledCount = 0; | |
@@ -295,7 +295,7 @@ function parseCommandLine() { | |||
| 295 | 295 | if (!coverageExcludeGlobs || coverageExcludeGlobs.length === 0) { | |
| 296 | 296 | // TODO(pmarchini): this default should follow something similar to c8 defaults | |
| 297 | 297 | // Default exclusions should be also exported to be used by other tools / users | |
| 298 | - coverageExcludeGlobs = kDefaultPattern; | ||
| 298 | + coverageExcludeGlobs = [kDefaultPattern]; | ||
| 299 | 299 | } | |
| 300 | 300 | coverageIncludeGlobs = getOptionValue('--test-coverage-include'); | |
| 301 | 301 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments