(snippet, config)
| 26 | }) |
| 27 | |
| 28 | function 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 | |
| 37 | function wrapForError(snippet, message) { |
| 38 | return "try { (function() {\n" + snippet + "})();\n" + |