MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / getTestSuites

Function getTestSuites

src/test/test_runner.ts:18–33  ·  view source on GitHub ↗
(testsRoot: string, filters: string[] | undefined)

Source from the content-addressed store, hash-verified

16}
17
18export async function getTestSuites(testsRoot: string, filters: string[] | undefined): Promise<string[]> {
19 let allFiles = await glob("**/**.test.js", { cwd: testsRoot });
20 allFiles = allFiles.map((f) => path.resolve(testsRoot, f));
21 allFiles.sort();
22
23 if (!filters?.length)
24 return allFiles;
25
26 // If there are filters, return those that match any of them.
27 const files = new Set<string>();
28 for (let filter of filters.map(normalizeTestFilter)) {
29 filter = `**/*${filter}*`;
30 allFiles.filter((file) => minimatch(file, filter)).forEach((f) => files.add(f));
31 }
32 return [...files].sort();
33}
34
35module.exports = {
36 getTestSuites,

Callers 2

runTestsFunction · 0.90
runFunction · 0.85

Calls 1

addMethod · 0.45

Tested by

no test coverage detected