Skip to content

Commit

Permalink
Merge pull request #10 from rei/fix-spawn
Browse files Browse the repository at this point in the history
Fixing spawn cross-platform compat issue
  • Loading branch information
peripateticus committed Mar 12, 2019
2 parents 49d29b8 + 7084f28 commit 9319886
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -22,7 +22,7 @@ for Mocha](https://vue-test-utils.vuejs.org/guides/testing-single-file-component

npx vunit --spec=<glob-to-specs> --coverage [--watch]

Report is generated at `./coverage-vue`
Report is generated at `./coverage`

## Creating Unit Tests

Expand Down
13 changes: 6 additions & 7 deletions 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');

Expand Down Expand Up @@ -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',
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions 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 <peripateticus.gh@gmail.com>",
"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"
Expand All @@ -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",
Expand Down

0 comments on commit 9319886

Please sign in to comment.