mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 17:47:49 +00:00
Fix phantomjs browser tests.
This commit is contained in:
@@ -5,10 +5,8 @@ node_js:
|
|||||||
- "0.10"
|
- "0.10"
|
||||||
env:
|
env:
|
||||||
global:
|
global:
|
||||||
- BIN="node" BUILD=false COMPAT=false MAKE=false OPTION="" SAUCE_LABS=false
|
- BIN="node" BUILD=false COMPAT=false MAKE=false OPTION="" SAUCE_LABS=false SAUCE_USERNAME="lodash"
|
||||||
- SAUCE_USERNAME="lodash"
|
- secure: "tg1JFsIFnxzLaTboFPOnm+aJCuMm5+JdhLlESlqg9x3fwro++7KCnwHKLNovhchaPe4otC43ZMB/nfWhDnDm11dKbm/V6HlTkED+dadTsaLxVDg6J+7yK41QhokBPJOxLV78iDaNaAQVYEirAgZ0yn8kFubxmNKV+bpCGQNc9yU="
|
||||||
- secure: "KtDS/UyWv11g9SWk8ylg7VKhMXxGIA06Pe6vBvIm+uhiMgRhUcy78TbFYwspa1wZbIzAoOfYsAXkwu4f8KHsnu80dnUeBzlnW825H6G2xMSU7Zox9aooznVFh3GIFGc+K5zfr78KWK/7lcH6FiVstodup7U5K6GTjgKHqFAHIUE="
|
|
||||||
- secure: "rYIm0IRvJg4KT+ODO3E3AChRBmq4ruKc6wPDlvPzmtWoa1zChFKwo9kERSFxQ9F+1xMo18NnYiJl6MD6oXQaXwYQF1eULr+yNCAT6GsiiWN40xVyxmdk3wgdcpvotqvTebooMaf/Ey5n6y4s07iAzMXxjWAcsWjb9xWMmtn9ssc="
|
|
||||||
matrix:
|
matrix:
|
||||||
- BUILD="compat"
|
- BUILD="compat"
|
||||||
- BUILD="modern"
|
- BUILD="modern"
|
||||||
|
|||||||
11
test/test.js
11
test/test.js
@@ -116,16 +116,7 @@
|
|||||||
page.onInitialized = function() {
|
page.onInitialized = function() {
|
||||||
page.evaluate(function() {
|
page.evaluate(function() {
|
||||||
document.addEventListener('DOMContentLoaded', function() {
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
var xhr = new XMLHttpRequest;
|
QUnit.done(callPhantom);
|
||||||
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);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
25
vendor/qunit-extras/qunit-extras.js
vendored
25
vendor/qunit-extras/qunit-extras.js
vendored
@@ -129,9 +129,14 @@
|
|||||||
modulePrinted;
|
modulePrinted;
|
||||||
|
|
||||||
/** Object shortcuts */
|
/** Object shortcuts */
|
||||||
var phantom = context.phantom,
|
var console = context.console,
|
||||||
|
phantom = context.phantom,
|
||||||
|
process = phantom || context.process,
|
||||||
document = !phantom && context.document;
|
document = !phantom && context.document;
|
||||||
|
|
||||||
|
/** Detects if running in a PhantomJS web page */
|
||||||
|
var isPhantomPage = typeof context.callPhantom == 'function';
|
||||||
|
|
||||||
/** Used to display the wait throbber */
|
/** Used to display the wait throbber */
|
||||||
var throbberId,
|
var throbberId,
|
||||||
throbberDelay = 500,
|
throbberDelay = 500,
|
||||||
@@ -369,11 +374,8 @@
|
|||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
// add CLI extras
|
// add logging extras
|
||||||
if (!document) {
|
if (isPhantomPage || !document) {
|
||||||
|
|
||||||
/** Add `console.log()` support for Narwhal, Rhino, and RingoJS */
|
|
||||||
var console = context.console || (context.console = { 'log': context.print });
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A logging callback triggered when all testing is completed.
|
* A logging callback triggered when all testing is completed.
|
||||||
@@ -399,7 +401,6 @@
|
|||||||
|
|
||||||
// exit out of Node.js or PhantomJS
|
// exit out of Node.js or PhantomJS
|
||||||
try {
|
try {
|
||||||
var process = context.process || context.phantom;
|
|
||||||
if (details.failed) {
|
if (details.failed) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
} else {
|
} else {
|
||||||
@@ -508,9 +509,12 @@
|
|||||||
return func(object);
|
return func(object);
|
||||||
};
|
};
|
||||||
}());
|
}());
|
||||||
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// add CLI extras
|
||||||
|
if (!document) {
|
||||||
// Timeout fallbacks based on the work of Andrea Giammarchi and Weston C.
|
// Timeout fallbacks based on the work of Andrea Giammarchi and Weston C.
|
||||||
// https://github.com/WebReflection/wru/blob/master/src/rhinoTimers.js
|
// 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
|
// http://stackoverflow.com/questions/2261705/how-to-run-a-javascript-function-asynchronously-without-using-settimeout
|
||||||
@@ -539,6 +543,9 @@
|
|||||||
}());
|
}());
|
||||||
} catch(e) { }
|
} catch(e) { }
|
||||||
|
|
||||||
|
// add `console.log` support to Narwhal, Rhino, and RingoJS
|
||||||
|
console || (console = context.console = { 'log': context.print });
|
||||||
|
|
||||||
// expose shortcuts
|
// expose shortcuts
|
||||||
// exclude `module` because some environments have it as a built-in object
|
// exclude `module` because some environments have it as a built-in object
|
||||||
('asyncTest deepEqual equal equals expect notDeepEqual notEqual notStrictEqual ' +
|
('asyncTest deepEqual equal equals expect notDeepEqual notEqual notStrictEqual ' +
|
||||||
@@ -546,7 +553,7 @@
|
|||||||
context[methodName] = QUnit[methodName];
|
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.config.autostart = false;
|
||||||
QUnit.init();
|
QUnit.init();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user