Created
January 18, 2013 18:30
-
-
Save paulkoegel/4566993 to your computer and use it in GitHub Desktop.
Synchronously load RequireJS-modularized QUnit tests and start QUnit afterwards
This fixes an annoying issue with rerunning single QUnit tests.
When loading tests asynchronously, single tests are identified by numerical IDs and since their order can change between reloads, you can't be sure you'll rerun the same test twice.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// author: Mathias Schäfer (@molily) | |
QUnit.config.autostart = false; | |
var modules = ['module_a', 'module_b']; | |
function loadNext () { | |
var module = modules.shift(); | |
if (module) { | |
require([module], loadNext); | |
} else { | |
QUnit.start(); | |
} | |
} | |
loadNext(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment