MCPcopy Index your code
hub / github.com/nodejs/node / createTestFileList

Function createTestFileList

lib/internal/test_runner/runner.js:152–170  ·  view source on GitHub ↗
(patterns, cwd)

Source from the content-addressed store, hash-verified

150}
151
152function createTestFileList(patterns, cwd) {
153 const hasUserSuppliedPattern = patterns != null;
154 if (!patterns || patterns.length === 0) {
155 patterns = [kDefaultPattern];
156 }
157 const glob = new Glob(patterns, {
158 __proto__: null,
159 cwd,
160 exclude: (name) => name === 'node_modules',
161 });
162 const results = glob.globSync();
163
164 if (hasUserSuppliedPattern && results.length === 0 && ArrayPrototypeEvery(glob.matchers, (m) => !m.hasMagic())) {
165 console.error(`Could not find '${ArrayPrototypeJoin(patterns, ', ')}'`);
166 process.exit(kGenericUserError);
167 }
168
169 return ArrayPrototypeSort(results);
170}
171
172function filterExecArgv(arg, i, arr) {
173 return !ArrayPrototypeIncludes(kFilterArgs, arg) &&

Callers 2

onChangedFunction · 0.85
runFunction · 0.85

Calls 4

globSyncMethod · 0.95
hasMagicMethod · 0.80
errorMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…