MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / testDoc

Function testDoc

lib/web/CodeMirror/test/doc_test.js:48–69  ·  view source on GitHub ↗
(name, spec, run, opts, expectFail)

Source from the content-addressed store, hash-verified

46 }
47
48 function testDoc(name, spec, run, opts, expectFail) {
49 if (!opts) opts = {};
50
51 return test("doc_" + name, function() {
52 var place = document.getElementById("testground");
53 var editors = instantiateSpec(spec, place, opts);
54 var successful = false;
55
56 try {
57 run.apply(null, editors);
58 successful = true;
59 } finally {
60 if (!successful || verbose) {
61 place.style.visibility = "visible";
62 } else {
63 for (var i = 0; i < editors.length; ++i)
64 if (editors[i] instanceof CodeMirror)
65 place.removeChild(editors[i].getWrapperElement());
66 }
67 }
68 }, expectFail);
69 }
70
71 var ie_lt8 = /MSIE [1-7]\b/.test(navigator.userAgent);
72

Callers 1

doc_test.jsFile · 0.85

Calls 3

instantiateSpecFunction · 0.85
testFunction · 0.70
applyMethod · 0.65

Tested by

no test coverage detected