MCPcopy Create free account
hub / github.com/arktypeio/arktype / narrowToNamedTestFiles

Function narrowToNamedTestFiles

ark/attest/utils.ts:29–40  ·  view source on GitHub ↗
(rootFiles: string[])

Source from the content-addressed store, hash-verified

27 * data", so a narrowing that missed a file can never pass silently.
28 */
29export const narrowToNamedTestFiles = (rootFiles: string[]): string[] => {
30 if (!getConfig().onlyNamedTestFiles) return rootFiles
31 const named = new Set(
32 process.argv
33 .slice(2)
34 .filter(arg => testFilePattern.test(arg) && existsSync(arg))
35 .map(arg => resolve(arg).replace(/\\/g, "/"))
36 )
37 if (!named.size) return rootFiles
38 const narrowed = rootFiles.filter(path => named.has(path))
39 return narrowed.length ? narrowed : rootFiles
40}
41
42/**
43 * Can be used to allow arbitrarily chained property access and function calls.

Callers 3

constructorMethod · 0.90
cli.test.tsFile · 0.90
constructorMethod · 0.90

Calls 7

getConfigFunction · 0.90
filterMethod · 0.80
testMethod · 0.80
replaceMethod · 0.80
mapMethod · 0.65
resolveFunction · 0.50
hasMethod · 0.45

Tested by

no test coverage detected