From 784b02e6426cbe46a1a90b46cb7e01b81ac05b9a Mon Sep 17 00:00:00 2001 From: Jacopo Farina Date: Thu, 11 Oct 2018 14:26:20 +0200 Subject: [PATCH] Use mocha-chrome instead of phantomjs mocha-phantomjs is deprecated, move to mocha-chrome to run tests. Additionally, upgrade mocha. Use fork of mocha-chrome which supports nodejs 6 Switch to npm mocha-chrome Instead of a fork of mocha-chrome which supports nodejs 6, use the one on NPM which is more updated but drops the support for it --- package.json | 8 ++++---- tests/test.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ae43241..5c3f0fa 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "eslint": "^4.19.1", "grunt": "^1.0.2", "grunt-contrib-uglify": "^3.3.0", - "mocha": "^3.5.0", - "mocha-phantomjs": "^4.1.0", + "mocha": "^5.2.0", + "mocha-chrome": "^1.1.0", "open": "0.0.5", "phantomjs-prebuilt": "^2.1.16", "serve-static": "^1.7.1" @@ -51,8 +51,8 @@ "scripts": { "lint": "eslint --no-ignore papaparse.js Gruntfile.js .eslintrc.js 'tests/**/*.js'", "test-browser": "node tests/test.js", - "test-phantomjs": "node tests/test.js --phantomjs", + "test-mocha-chrome": "node tests/test.js --mocha-chrome", "test-node": "mocha tests/node-tests.js tests/test-cases.js", - "test": "npm run lint && npm run test-node && npm run test-phantomjs" + "test": "npm run lint && npm run test-node && npm run test-mocha-chrome" } } diff --git a/tests/test.js b/tests/test.js index f4fed5f..5292d5f 100644 --- a/tests/test.js +++ b/tests/test.js @@ -5,8 +5,8 @@ var path = require('path'); var childProcess = require('child_process'); var server = connect().use(serveStatic(path.join(__dirname, '/..'))).listen(8071, function() { - if (process.argv.indexOf('--phantomjs') !== -1) { - childProcess.spawn('node_modules/.bin/mocha-phantomjs', ['http://localhost:8071/tests/tests.html'], { + if (process.argv.indexOf('--mocha-chrome') !== -1) { + childProcess.spawn('node_modules/.bin/mocha-chrome', ['http://localhost:8071/tests/tests.html'], { stdio: 'inherit' }).on('exit', function(code) { server.close();