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

Function readTraceZip

test/browser/specs/playwright-trace-mark.test.ts:294–310  ·  view source on GitHub ↗
(zipPath: string)

Source from the content-addressed store, hash-verified

292})
293
294async function readTraceZip(zipPath: string): Promise<{ entries: string[]; events: any[] }> {
295 const zipFile = new ZipFile(zipPath)
296 try {
297 const entries = await zipFile.entries()
298 const traceText = (await zipFile.read('trace.trace')).toString('utf-8')
299 const events = traceText
300 .split('\n')
301 .filter(Boolean)
302 .map((line) => {
303 return JSON.parse(line)
304 })
305 return { entries, events }
306 }
307 finally {
308 zipFile.close()
309 }
310}
311
312// https://github.com/microsoft/playwright/blob/cd36dab6ecc7f4b3adeec333e55f9ac03711a9b1/packages/playwright-core/src/server/utils/zipFile.ts#L21
313class ZipFile {

Callers 1

Calls 5

entriesMethod · 0.95
readMethod · 0.95
closeMethod · 0.95
filterMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected