From dfe4cfc71a238792357d01ea374e860505ef9ad3 Mon Sep 17 00:00:00 2001 From: Trent Willis Date: Thu, 1 Mar 2018 11:16:23 -0800 Subject: [PATCH] Test: Refactor startError test to not reload QUnit --- test/startError.html | 22 ---------------------- test/startError.js | 24 ++++++++++++++++++------ 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/test/startError.html b/test/startError.html index a819121db..517ee2402 100644 --- a/test/startError.html +++ b/test/startError.html @@ -8,28 +8,6 @@
- - - - - diff --git a/test/startError.js b/test/startError.js index 8e96b5fcd..51d6fc1da 100644 --- a/test/startError.js +++ b/test/startError.js @@ -1,3 +1,16 @@ +try { + QUnit.config.autostart = true; + QUnit.start(); +} catch ( thrownError ) { + window.autostartStartError = thrownError; +} + +try { + QUnit.start(); +} catch ( thrownError ) { + window.tooManyStartsError = thrownError; +} + QUnit.module( "global start unrecoverable errors" ); QUnit.test( "start() throws when QUnit.config.autostart === true", function( assert ) { @@ -6,9 +19,8 @@ QUnit.test( "start() throws when QUnit.config.autostart === true", function( ass "Called start() outside of a test context when QUnit.config.autostart was true" ); } ); -QUnit.test( "Throws after calling start() too many times outside of a test context", - function( assert ) { - assert.expect( 1 ); - assert.equal( window.tooManyStartsError.message, - "Called start() outside of a test context too many times" ); - } ); +QUnit.test( "Throws after calling start() too many times outside of a test context", function( assert ) { + assert.expect( 1 ); + assert.equal( window.tooManyStartsError.message, + "Called start() outside of a test context too many times" ); +} );