Browse Source

Move to mocha-headless-chrome for running tests

Additionally, upgrade mocha.
pull/599/head
Jacopo Farina 6 years ago committed by Sergi Almacellas Abellana
parent
commit
9a4a00a1ee
  1. 8
      package.json
  2. 4
      tests/test.js

8
package.json

@ -42,8 +42,8 @@
"eslint": "^4.19.1", "eslint": "^4.19.1",
"grunt": "^1.0.2", "grunt": "^1.0.2",
"grunt-contrib-uglify": "^3.3.0", "grunt-contrib-uglify": "^3.3.0",
"mocha": "^3.5.0", "mocha": "^5.2.0",
"mocha-phantomjs": "^4.1.0", "mocha-headless-chrome": "^2.0.1",
"open": "0.0.5", "open": "0.0.5",
"phantomjs-prebuilt": "^2.1.16", "phantomjs-prebuilt": "^2.1.16",
"serve-static": "^1.7.1" "serve-static": "^1.7.1"
@ -51,8 +51,8 @@
"scripts": { "scripts": {
"lint": "eslint --no-ignore papaparse.js Gruntfile.js .eslintrc.js 'tests/**/*.js'", "lint": "eslint --no-ignore papaparse.js Gruntfile.js .eslintrc.js 'tests/**/*.js'",
"test-browser": "node tests/test.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-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"
} }
} }

4
tests/test.js

@ -5,8 +5,8 @@ var path = require('path');
var childProcess = require('child_process'); var childProcess = require('child_process');
var server = connect().use(serveStatic(path.join(__dirname, '/..'))).listen(8071, function() { var server = connect().use(serveStatic(path.join(__dirname, '/..'))).listen(8071, function() {
if (process.argv.indexOf('--phantomjs') !== -1) { if (process.argv.indexOf('--mocha-headless-chrome') !== -1) {
childProcess.spawn('node_modules/.bin/mocha-phantomjs', ['http://localhost:8071/tests/tests.html'], { childProcess.spawn('node_modules/.bin/mocha-headless-chrome', ['-f', 'http://localhost:8071/tests/tests.html'], {
stdio: 'inherit' stdio: 'inherit'
}).on('exit', function(code) { }).on('exit', function(code) {
server.close(); server.close();

Loading…
Cancel
Save