Skip to content

Commit

Permalink
HTML Reporter: Check for undefined testItem in testDone callback
Browse files Browse the repository at this point in the history
For added robustness, allow the DOM node to be missing at this point
just in case. Extracted from #1391.

Co-authored-by: step2yeung <[email protected]>
  • Loading branch information
Krinkle and step2yeung authored Mar 13, 2021
1 parent e295106 commit 036ac23
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/html-reporter/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -902,16 +902,15 @@ export function escapeText( s ) {
} );

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

if ( !tests ) {
if ( !tests || !testItem ) {
return;
}

testItem = id( "qunit-test-output-" + details.testId );

removeClass( testItem, "running" );

if ( details.failed > 0 ) {
Expand Down

0 comments on commit 036ac23

Please sign in to comment.