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

Method readFile

packages/vitest/src/runtime/vm/file-map.ts:19–27  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

17 }
18
19 public readFile(path: string): string {
20 const cached = this.fsCache.get(path)
21 if (cached != null) {
22 return cached
23 }
24 const source = readFileSync(path, 'utf-8')
25 this.fsCache.set(path, source)
26 return source
27 }
28
29 public readBuffer(path: string): Buffer<ArrayBuffer> {
30 const cached = this.fsBufferCache.get(path)

Callers 15

readSnapshotFileFunction · 0.80
readFileFunction · 0.80
_fileInfoFunction · 0.80
parseConfigModuleMethod · 0.80
parseConfigModuleMethod · 0.80
getSourcesMethod · 0.80
onTestRunEndMethod · 0.80
writeReportMethod · 0.80
getSpecificationsOptionsFunction · 0.80
readTestFileFunction · 0.80
getExternalResultFunction · 0.80
getTransformResultFunction · 0.80

Calls 3

readFileSyncFunction · 0.85
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected