Update phantomjs and use mocha-phantomjs-core

This commit is contained in:
Tim Schaub
2015-11-01 01:45:47 -06:00
parent 7946298e67
commit 98c9b0eb39
4 changed files with 20 additions and 26 deletions

View File

@@ -16,6 +16,9 @@
<script type="text/javascript" src="../node_modules/proj4/dist/proj4.js"></script>
<script type="text/javascript" src="test-extensions.js"></script>
<script>
if (typeof initMochaPhantomJS === 'function') {
initMochaPhantomJS()
}
mocha.setup({
ui: 'bdd',
bail: false
@@ -43,25 +46,21 @@
*/
goog.events.listen(this, 'test', function() {});
if (window.mochaPhantomJS) {
mochaPhantomJS.run();
} else {
var runner = mocha.run();
if (window.console && console.log) {
// write stacks to the console for failed tests
runner.on('fail', function(test, err) {
if (test.duration > test._timeout) {
var titles = [];
for (var p = test; p; p = p.parent) {
if (p.title) {
titles.unshift(p.title);
}
var runner = mocha.run();
if (window.console && console.log) {
// write stacks to the console for failed tests
runner.on('fail', function(test, err) {
if (test.duration > test._timeout) {
var titles = [];
for (var p = test; p; p = p.parent) {
if (p.title) {
titles.unshift(p.title);
}
console.log('Test timed out:', titles.join(' > '));
}
console.error(test.err.stack);
});
}
console.log('Test timed out:', titles.join(' > '));
}
console.error(test.err.stack);
});
}
</script>
<!--

View File

@@ -10,7 +10,7 @@ var blue = 'data:image/gif;base64,R0lGODlhAQABAPAAAAAA/////yH5BAAAAAAALAAAAA' +
'ABAAEAAAICRAEAOw==';
function itNoPhantom() {
if (window.mochaPhantomJS) {
if (window.initMochaPhantomJS) {
return xit.apply(this, arguments);
} else {
return it.apply(this, arguments);