MCPcopy Create free account
hub / github.com/compat-table/compat-table / testCode

Function testCode

runner_support.js:26–40  ·  view source on GitHub ↗
(exec)

Source from the content-addressed store, hash-verified

24}
25
26function testCode(exec) {
27 if (typeof exec === 'function') {
28 var src = exec.toString();
29 var functionBody = /^function\s*\w*\s*\(.*?\)\s*\{\s*\/\*([\s\S]*?)\*\/\s*\}$/m.exec(src);
30 if (functionBody) {
31 return '(function () { ' + removeIndent(functionBody[1]) + ' })()';
32 } else {
33 return '(' + src + ')()';
34 }
35 } else if (Array.isArray(exec)) {
36 return exec.map(function (e) { return testCode(e.script); }).join("; ");
37 } else {
38 return undefined;
39 }
40}
41
42exports.runTests = function runTests(runner, key, family, options) {
43 options = options === undefined ? {} : options;

Callers 1

runTestFunction · 0.85

Calls 1

removeIndentFunction · 0.85

Tested by

no test coverage detected