10000 Fix test runner with phantomjs and dojo loader. · lodash/lodash@3560fed · GitHub
[go: up one dir, main page]

Skip to content

Commit 3560fed

Browse files
committed
Fix test runner with phantomjs and dojo loader.
1 parent 5f8f5a9 commit 3560fed

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

test/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@
3636
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
3737

3838
// load test.js if not using require.js
39-
document.write(ui.urlParams.loader != 'none'
40-
? '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
41-
: '<script src="test.js"><\/script>'
39+
document.write(ui.urlParams.loader == 'none'
40+
? '<script src="test.js"><\/script>'
41+
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
4242
);
4343
</script>
4444
<script>

test/test.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4656,8 +4656,6 @@
46564656

46574657
/*--------------------------------------------------------------------------*/
46584658

4659-
// configure QUnit and call `QUnit.start()` for
4660-
// Narwhal, Node.js, PhantomJS, Rhino, and RingoJS
46614659
if (!document) {
46624660
QUnit.config.noglobals = true;
46634661
QUnit.start();

vendor/qunit-clib/qunit-clib.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,11 @@
276276
context[methodName] = QUnit[methodName];
277277
});
278278

279-
// must call `QUnit.start()` in the test file if using QUnit < 1.3.0 with
280-
// Node.js or any version of QUnit with Narwhal, PhantomJS, Rhino, or RingoJS
281-
QUnit.init();
279+
// must call `QUnit.start()` in the test file if not loaded in a browser
280+
if (!context.document || context.phantom) {
281+
QUnit.config.autostart = false;
282+
QUnit.init();
283+
}
282284
}
283285

284286
/*--------------------------------------------------------------------------*/

0 commit comments

Comments
 (0)
0