diff options
Diffstat (limited to 'test/index.html')
-rw-r--r-- | test/index.html | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/test/index.html b/test/index.html index fff50faab..6260c49da 100644 --- a/test/index.html +++ b/test/index.html @@ -19,7 +19,7 @@ <!-- See testinit for the list of tests --> <script src="data/testinit.js"></script> - <!-- A script that includes jQuery min, dev, ES modules or AMD --> + <!-- A script that includes jQuery min, dev, ES modules or AMD modules --> <!-- Adds "basic" URL option, even to iframes --> <!-- iframes will not load AMD as loading needs to be synchronous for some tests --> <!-- Also executes the function above to load tests --> @@ -29,7 +29,15 @@ // Load tests if they have not been loaded // This is in a different script tag to ensure that // jQuery is on the page when the testrunner executes - if ( !QUnit.urlParams.esmodules && !QUnit.urlParams.amd ) { + // QUnit.config is populated from QUnit.urlParams but only at the beginning + // of the test run. We need to read both. + var esmodules = QUnit.config.esmodules || QUnit.urlParams.esmodules, + amd = QUnit.config.amd || QUnit.urlParams.amd; + + // Workaround: Remove call to `window.__karma__.loaded()` + // in favour of calling `window.__karma__.start()` from `loadTests()` + // because tests such as unit/ready.js should run after document ready. + if ( !esmodules && !amd ) { loadTests(); } </script> |