Skip to content
This repository was archived by the owner on Apr 22, 2020. It is now read-only.

Commit 185276e

Browse files
amroamroamromikesamuel
authored andcommitted
modules_tests: fill job object fields
1 parent 80860ab commit 185276e

File tree

1 file changed

+19
-9
lines changed

1 file changed

+19
-9
lines changed

tests/recombineTagsAndDecorations_test.html

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,26 @@ <h1>Recombine Tags And Decorations Test</h1>
5454
// td.actual
5555
var actual = testResult.nextSibling;
5656
while (actual.nodeType !== 1) { actual = actual.nextSibling; }
57-
// make a copy of input node (modified in-place)
58-
var clone = testInput.cloneNode(true);
59-
clone.className = ''; // IE
60-
clone.removeAttribute('class'); // Not IE.
61-
actual.appendChild(clone);
62-
// run function
63-
var isPreformatted = /pre|xmp/i.test(clone.tagName);
64-
var job = extractSourceSpans(clone, isPreformatted);
65-
job.decorations = eval(decorationsNode.innerText || decorationsNode.textContent);
6657
try {
58+
// make a copy of input node (modified in-place)
59+
var clone = testInput.cloneNode(true);
60+
clone.className = ''; // IE
61+
clone.removeAttribute('class'); // Not IE.
62+
actual.appendChild(clone);
63+
// run function
64+
var isPreformatted = /pre|xmp/i.test(clone.tagName);
65+
var sourceAndSpans = extractSourceSpans(clone, isPreformatted);
66+
var job = {
67+
sourceCode: sourceAndSpans.sourceCode,
68+
spans: sourceAndSpans.spans,
69+
sourceNode: clone, // null
70+
pre: isPreformatted,
71+
langExtension: null,
72+
numberLines: null,
73+
basePos: 0,
74+
decorations: eval(
75+
decorationsNode.innerText || decorationsNode.textContent)
76+
};
6777
recombineTagsAndDecorations(job);
6878
// compare result against expected
6979
var passed = testResult.innerHTML === actual.innerHTML;

0 commit comments

Comments
 (0)