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.
  • Loading branch information
step2yeung authored and Krinkle committed May 3, 2019
1 parent e295106 commit 900c66e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/html-reporter/html.js
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 900c66e

Please sign in to comment.