MCPcopy
hub / github.com/desktop/desktop / findTestFilesIn

Function findTestFilesIn

script/test.mjs:10–28  ·  view source on GitHub ↗
(paths)

Source from the content-addressed store, hash-verified

8}
9
10async function findTestFilesIn(paths) {
11 const files = []
12 for (const path of paths) {
13 const entry = await stat(path)
14 if (entry.isFile()) {
15 files.push(path)
16 continue
17 }
18
19 for (const file of await readdir(path, { recursive: true }).then(x =>
20 x
21 .filter(f => /-test\.(ts|tsx|js|jsx|mts|mjs)$/.test(f))
22 .map(f => join(path, f))
23 )) {
24 files.push(file)
25 }
26 }
27 return files
28}
29
30const fileArgs = process.argv.slice(2).filter(a => !a.startsWith('--'))
31const switchArgs = process.argv.slice(2).filter(a => a.startsWith('--'))

Callers 1

test.mjsFile · 0.85

Calls 2

filterMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected