MCPcopy
hub / github.com/epicweb-dev/react-performance / captureOutput

Function captureOutput

epicshop/test.js:17–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15const __dirname = path.dirname(fileURLToPath(import.meta.url))
16
17function captureOutput() {
18 const output = []
19 return {
20 write: (chunk, streamType) => {
21 output.push({ chunk: chunk.toString(), streamType })
22 },
23 replay: () => {
24 for (const { chunk, streamType } of output) {
25 if (streamType === 'stderr') {
26 process.stderr.write(chunk)
27 } else {
28 process.stdout.write(chunk)
29 }
30 }
31 },
32 hasOutput: () => output.length > 0,
33 }
34}
35
36function printTestSummary(results) {
37 const label = '--- Test Summary ---'

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected