diff --git a/package.json b/package.json index 5fff44e465..2eb87d1e32 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "jquery": "2.1.4", "jshint": "2.8.0", "mocha": "2.3.3", - "mocha-phantomjs-core": "1.2.1", + "mocha-phantomjs-core": "^1.3.0", "mustache": "2.2.0", "phantomjs": "1.9.18", "proj4": "2.3.12", diff --git a/tasks/test.js b/tasks/test.js index 6276bd34f3..48a96c56ab 100644 --- a/tasks/test.js +++ b/tasks/test.js @@ -59,14 +59,20 @@ function runTests(includeCoverage, callback) { var url = 'http://' + address.address + ':' + address.port; var args = [ require.resolve('mocha-phantomjs-core'), - url + '/test/index.html' + url + '/test/index.html', + 'spec' ]; + var config = { + ignoreResourceErrors: true, + useColors: true, + }; if (includeCoverage) { - args.push('spec', '{"hooks": "' + - path.join(__dirname, '../test/phantom_hooks.js') + '"}'); + config.hooks = path.join(__dirname, '../test/phantom_hooks.js'); } + args.push(JSON.stringify(config)); + var child = spawn(phantomjs.path, args, {stdio: 'inherit'}); child.on('exit', function(code) { callback(code); diff --git a/test/spec/ol/source/rastersource.test.js b/test/spec/ol/source/rastersource.test.js index 4ea9ec4887..8300460f2d 100644 --- a/test/spec/ol/source/rastersource.test.js +++ b/test/spec/ol/source/rastersource.test.js @@ -10,7 +10,7 @@ var blue = 'data:image/gif;base64,R0lGODlhAQABAPAAAAAA/////yH5BAAAAAAALAAAAA' + 'ABAAEAAAICRAEAOw=='; function itNoPhantom() { - if (window.initMochaPhantomJS) { + if (window.checkForMocha) { return xit.apply(this, arguments); } else { return it.apply(this, arguments);