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

Function readTestFile

packages/vitest/src/api/setup.ts:68–73  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

66 return ctx.state.getPaths()
67 },
68 async readTestFile(id) {
69 if (!ctx.state.filesMap.has(id) || !existsSync(id)) {
70 return null
71 }
72 return fs.readFile(id, 'utf-8')
73 },
74 async saveTestFile(id, content) {
75 if (!ctx.state.filesMap.has(id) || !existsSync(id)) {
76 throw new Error(

Callers

nothing calls this directly

Calls 2

readFileMethod · 0.80
hasMethod · 0.45

Tested by

no test coverage detected