MCPcopy
hub / github.com/vitest-dev/vitest / globFiles

Method globFiles

packages/vitest/src/node/project.ts:391–404  ·  view source on GitHub ↗

@internal

(include: string[], exclude: string[], cwd: string)

Source from the content-addressed store, hash-verified

389
390 /** @internal */
391 async globFiles(include: string[], exclude: string[], cwd: string) {
392 const globOptions: GlobOptions = {
393 dot: true,
394 cwd,
395 ignore: exclude,
396 expandDirectories: false,
397 }
398
399 const files = await glob(include, globOptions)
400 // keep the slashes consistent with Vite
401 // we are not using the pathe here because it normalizes the drive letter on Windows
402 // and we want to keep it the same as working dir
403 return files.map(file => slash(path.resolve(cwd, file)))
404 }
405
406 /**
407 * Test if a file matches the test globs. This does the actual glob matching if the test is not cached, unlike `isCachedTestFile`.

Callers 2

globTestFilesMethod · 0.95
globAllTestFilesMethod · 0.95

Calls 2

slashFunction · 0.90
resolveMethod · 0.45

Tested by

no test coverage detected