Skip to content

Commit 900c66e

Browse files
step2yeungKrinkle
authored andcommitted
HTML Reporter: Check for undefined testItem in testDone callback
For added robustness, allow the DOM node to be missing at this point just in case. Extracted from #1391.
1 parent e295106 commit 900c66e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/html-reporter/html.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -902,16 +902,15 @@ export function escapeText( s ) {
902902
} );
903903

904904
QUnit.testDone( function( details ) {
905-
var testTitle, time, testItem, assertList, status,
905+
var testTitle, time, assertList, status,
906906
good, bad, testCounts, skipped, sourceName,
907-
tests = id( "qunit-tests" );
907+
tests = id( "qunit-tests" ),
908+
testItem = id( "qunit-test-output-" + details.testId );
908909

909-
if ( !tests ) {
910+
if ( !tests || !testItem ) {
910911
return;
911912
}
912913

913-
testItem = id( "qunit-test-output-" + details.testId );
914-
915914
removeClass( testItem, "running" );
916915

917916
if ( details.failed > 0 ) {

0 commit comments

Comments
 (0)