mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
27 lines
779 B
JavaScript
27 lines
779 B
JavaScript
var page = require('webpage').create();
|
|
var system = require('system');
|
|
var platform = system.args[1] || "local";
|
|
console.log("Running Meteor tests in PhantomJS... " + system.env.URL);
|
|
page.onConsoleMessage = function (message) {
|
|
console.log(message);
|
|
};
|
|
page.open(system.env.URL + platform);
|
|
setInterval(function () {
|
|
var done = page.evaluate(function () {
|
|
if (typeof TEST_STATUS !== 'undefined')
|
|
return TEST_STATUS.DONE;
|
|
return typeof DONE !== 'undefined' && DONE;
|
|
});
|
|
if (done) {
|
|
var failures = page.evaluate(function () {
|
|
if (typeof TEST_STATUS !== 'undefined')
|
|
return TEST_STATUS.FAILURES;
|
|
if (typeof FAILURES === 'undefined') {
|
|
return 1;
|
|
}
|
|
return 0;
|
|
});
|
|
phantom.exit(failures ? 1 : 0);
|
|
}
|
|
}, 500);
|