diff --git a/README.md b/README.md index 5284a2f..e873737 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ for Mocha](https://vue-test-utils.vuejs.org/guides/testing-single-file-component npx vunit --spec= --coverage [--watch] - Report is generated at `./coverage-vue` + Report is generated at `./coverage` ## Creating Unit Tests diff --git a/core.js b/core.js index c150d63..5441f38 100644 --- a/core.js +++ b/core.js @@ -1,5 +1,5 @@ const os = require('os'); -const cp = require('child_process'); +const spawn = require('cross-spawn'); const path = require('path'); const chokidar = require('chokidar'); @@ -49,7 +49,8 @@ module.exports.run = (conf) => { 'NODE_ENV=test', 'nyc', '--reporter=lcov', - '--report-dir=coverage-vue', + '--reporter=text', + '--report-dir=coverage', 'mocha-webpack', '--require', path.join(__dirname, 'setup.js'), '--colors', @@ -60,15 +61,13 @@ module.exports.run = (conf) => { confPreprocessed.specGlob, ]; - // Remove nyc its options if not running coverage. + // Remove nyc and its options if not running coverage. if (!confPreprocessed.coverage) { - spawnCmd.splice(3, 3); + spawnCmd.splice(3, 4); } - // Remove reporter if not running - // Execute mocha-webpack. - const cmd = cp.spawn('npx', spawnCmd); + const cmd = spawn('npx', spawnCmd); cmd.stdout.on('data', (data) => { const d = data.toString(); diff --git a/package-lock.json b/package-lock.json index 343ffd1..fd0ed95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@rei/vunit", - "version": "1.3.0", + "version": "1.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -5916,7 +5916,7 @@ }, "chalk": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", + "resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "requires": { "ansi-styles": "^2.2.1", diff --git a/package.json b/package.json index f27115a..176f0f3 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "@rei/vunit", "description": "Write unit tests against your Vue components using mocha and vue-test-utils", - "version": "1.3.0", + "version": "1.4.0", "author": "Alex Perkins ", "repository": "https://github.com/rei/vunit", "license": "MIT", "main": "./index.js", "scripts": { - "test": "NODE_TEST=test mocha" + "test": "mocha --timeout 5000" }, "bin": { "vunit": "./index.js" @@ -24,6 +24,7 @@ "babel-plugin-istanbul": "^4.1.5", "chokidar": "^2.0.4", "cross-env": "^5.0.5", + "cross-spawn": "^6.0.5", "css-loader": "^0.28.7", "expect": "^21.2.1", "glob": "^7.1.3",