MCPcopy Index your code
hub / github.com/braziljs/eloquente-javascript / wrapTestOutput

Function wrapTestOutput

src/run_tests.mjs:28–35  ·  view source on GitHub ↗
(snippet, config)

Source from the content-addressed store, hash-verified

26})
27
28function wrapTestOutput(snippet, config) {
29 let output = "", m, re = /\/\/ → (.*\n)((?:\/\/ .*\n)*)/g
30 while (m = re.exec(snippet)) {
31 output += m[1]
32 if (m[2]) output += m[2].replace(/\/\/ /g, "")
33 }
34 return "console.clear();\n" + snippet + "console.verify(" + JSON.stringify(output) + ", " + JSON.stringify(config) + ");\n"
35}
36
37function wrapForError(snippet, message) {
38 return "try { (function() {\n" + snippet + "})();\n" +

Callers 1

run_tests.mjsFile · 0.85

Calls 1

replaceMethod · 0.45

Tested by

no test coverage detected