From 80958dbce0059f871f4a08c090eba6854dd6e4b5 Mon Sep 17 00:00:00 2001 From: Alex Perkins Date: Mon, 11 Mar 2019 18:00:54 -0700 Subject: [PATCH 1/4] Fixing spawn cross-platform compat issue - Make spawn command cross-platform (Windows) compatible. --- core.js | 4 ++-- package-lock.json | 4 ++-- package.json | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/core.js b/core.js index c150d63..c4d6157 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'); @@ -68,7 +68,7 @@ module.exports.run = (conf) => { // 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..71cefa7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@rei/vunit", - "version": "1.3.0", + "version": "1.3.1", "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..6d5f4c5 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.3.1", "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", From 3dabcab9a0526ce271e447175e8162d9ee124d8b Mon Sep 17 00:00:00 2001 From: Alex Perkins Date: Tue, 12 Mar 2019 09:29:47 -0700 Subject: [PATCH 2/4] Run text and lcov reports. - Run both text and lcov reports when running nyc. --- core.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/core.js b/core.js index c4d6157..5441f38 100644 --- a/core.js +++ b/core.js @@ -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,13 +61,11 @@ 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 = spawn('npx', spawnCmd); From 80159dd521eee643db7870785331d3720cef6f59 Mon Sep 17 00:00:00 2001 From: Alex Perkins Date: Tue, 12 Mar 2019 11:03:30 -0700 Subject: [PATCH 3/4] Update Running Test Coverage section --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 7084f28e366eee00050e61fa4f08d279444abb10 Mon Sep 17 00:00:00 2001 From: Alex Perkins Date: Tue, 12 Mar 2019 11:04:37 -0700 Subject: [PATCH 4/4] Bump minor version. --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 71cefa7..fd0ed95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@rei/vunit", - "version": "1.3.1", + "version": "1.4.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 6d5f4c5..176f0f3 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@rei/vunit", "description": "Write unit tests against your Vue components using mocha and vue-test-utils", - "version": "1.3.1", + "version": "1.4.0", "author": "Alex Perkins ", "repository": "https://github.com/rei/vunit", "license": "MIT",