MCPcopy Index your code
hub / github.com/codeceptjs/CodeceptJS / writeTraceMarkdown

Function writeTraceMarkdown

lib/utils/trace.js:71–93  ·  view source on GitHub ↗
({ dir, title, file, durationMs, commands, captured, error })

Source from the content-addressed store, hash-verified

69}
70
71export function writeTraceMarkdown({ dir, title, file, durationMs, commands, captured, error }) {
72 let md = `file: ${file || 'mcp'}\n`
73 md += `name: ${title}\n`
74 md += `time: ${(durationMs / 1000).toFixed(2)}s\n`
75 md += `---\n\n`
76
77 if (error) md += `Error: ${error}\n\n---\n\n`
78
79 if (commands && commands.length) {
80 md += `### Commands\n`
81 for (const c of commands) md += `- ${c}\n`
82 md += `\n`
83 }
84
85 md += `### Final State\n`
86 if (captured.url) md += ` > URL: ${captured.url}\n`
87 const links = artifactLinks(captured)
88 if (links) md += links + '\n'
89
90 const traceFile = path.join(dir, 'trace.md')
91 fs.writeFileSync(traceFile, md)
92 return traceFile
93}
94
95export function artifactsToFileUrls(captured, dir) {
96 const out = {}

Callers 2

trace_test.jsFile · 0.90
mcp-server.jsFile · 0.90

Calls 1

artifactLinksFunction · 0.85

Tested by

no test coverage detected