From 9a4a00a1ee8753eb2a106ef2de86d3a8a8bba698 Mon Sep 17 00:00:00 2001 From: Jacopo Farina Date: Thu, 11 Oct 2018 14:26:20 +0200 Subject: [PATCH] Move to mocha-headless-chrome for running tests Additionally, upgrade mocha. --- package.json | 8 ++++---- tests/test.js | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index ae43241..0072ac1 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-headless-chrome": "^2.0.1", "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-headless-chrome": "node tests/test.js --mocha-headless-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-headless-chrome" } } diff --git a/tests/test.js b/tests/test.js index f4fed5f..2741831 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-headless-chrome') !== -1) { + childProcess.spawn('node_modules/.bin/mocha-headless-chrome', ['-f', 'http://localhost:8071/tests/tests.html'], { stdio: 'inherit' }).on('exit', function(code) { server.close();