diff --git a/.travis.yml b/.travis.yml index 8ce3e3269..d47b4bcbf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,8 @@ node_js: - "0.10" env: global: - - BIN="node" BUILD=false COMPAT=false MAKE=false OPTION="" SAUCE_LABS=false - - SAUCE_USERNAME="lodash" - - secure: "KtDS/UyWv11g9SWk8ylg7VKhMXxGIA06Pe6vBvIm+uhiMgRhUcy78TbFYwspa1wZbIzAoOfYsAXkwu4f8KHsnu80dnUeBzlnW825H6G2xMSU7Zox9aooznVFh3GIFGc+K5zfr78KWK/7lcH6FiVstodup7U5K6GTjgKHqFAHIUE=" - - secure: "rYIm0IRvJg4KT+ODO3E3AChRBmq4ruKc6wPDlvPzmtWoa1zChFKwo9kERSFxQ9F+1xMo18NnYiJl6MD6oXQaXwYQF1eULr+yNCAT6GsiiWN40xVyxmdk3wgdcpvotqvTebooMaf/Ey5n6y4s07iAzMXxjWAcsWjb9xWMmtn9ssc=" + - BIN="node" BUILD=false COMPAT=false MAKE=false OPTION="" SAUCE_LABS=false SAUCE_USERNAME="lodash" + - secure: "tg1JFsIFnxzLaTboFPOnm+aJCuMm5+JdhLlESlqg9x3fwro++7KCnwHKLNovhchaPe4otC43ZMB/nfWhDnDm11dKbm/V6HlTkED+dadTsaLxVDg6J+7yK41QhokBPJOxLV78iDaNaAQVYEirAgZ0yn8kFubxmNKV+bpCGQNc9yU=" matrix: - BUILD="compat" - BUILD="modern" diff --git a/test/test.js b/test/test.js index ca6946670..6a7ca5f4e 100644 --- a/test/test.js +++ b/test/test.js @@ -116,16 +116,7 @@ page.onInitialized = function() { page.evaluate(function() { document.addEventListener('DOMContentLoaded', function() { - var xhr = new XMLHttpRequest; - xhr.open('get', '../vendor/qunit-clib/qunit-clib.js'); - xhr.onload = function() { - var script = document.createElement('script'); - script.text = xhr.responseText; - document.head.appendChild(script); - QUnit.done(callPhantom); - }; - - xhr.send(null); + QUnit.done(callPhantom); }); }); }; diff --git a/vendor/qunit-extras/qunit-extras.js b/vendor/qunit-extras/qunit-extras.js index 3fca776be..074d45f4a 100644 --- a/vendor/qunit-extras/qunit-extras.js +++ b/vendor/qunit-extras/qunit-extras.js @@ -129,9 +129,14 @@ modulePrinted; /** Object shortcuts */ - var phantom = context.phantom, + var console = context.console, + phantom = context.phantom, + process = phantom || context.process, document = !phantom && context.document; + /** Detects if running in a PhantomJS web page */ + var isPhantomPage = typeof context.callPhantom == 'function'; + /** Used to display the wait throbber */ var throbberId, throbberDelay = 500, @@ -369,11 +374,8 @@ /*------------------------------------------------------------------------*/ - // add CLI extras - if (!document) { - - /** Add `console.log()` support for Narwhal, Rhino, and RingoJS */ - var console = context.console || (context.console = { 'log': context.print }); + // add logging extras + if (isPhantomPage || !document) { /** * A logging callback triggered when all testing is completed. @@ -399,7 +401,6 @@ // exit out of Node.js or PhantomJS try { - var process = context.process || context.phantom; if (details.failed) { process.exit(1); } else { @@ -508,9 +509,12 @@ return func(object); }; }()); + } - /*----------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ + // add CLI extras + if (!document) { // Timeout fallbacks based on the work of Andrea Giammarchi and Weston C. // https://github.com/WebReflection/wru/blob/master/src/rhinoTimers.js // http://stackoverflow.com/questions/2261705/how-to-run-a-javascript-function-asynchronously-without-using-settimeout @@ -539,6 +543,9 @@ }()); } catch(e) { } + // add `console.log` support to Narwhal, Rhino, and RingoJS + console || (console = context.console = { 'log': context.print }); + // expose shortcuts // exclude `module` because some environments have it as a built-in object ('asyncTest deepEqual equal equals expect notDeepEqual notEqual notStrictEqual ' + @@ -546,7 +553,7 @@ context[methodName] = QUnit[methodName]; }); - // must call `QUnit.start()` in the test file if not loaded in a browser + // must call `QUnit.start` in the test file if not loaded in a browser QUnit.config.autostart = false; QUnit.init(); }