Skip to content

Commit

Permalink
travis: test on Windows (nodejs#719)
Browse files Browse the repository at this point in the history
Run CI on Windows.
  • Loading branch information
lpinca authored and BridgeAR committed Apr 20, 2019
1 parent 46e3809 commit a65183f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -2,6 +2,7 @@ language: node_js
os:
- linux
- osx
- windows
node_js:
- '11'
- '10'
Expand Down
8 changes: 7 additions & 1 deletion lib/spawn.js
Expand Up @@ -12,7 +12,13 @@ function spawn(cmd, args, options) {
args = [cmd].concat(args);
cmd = process.execPath;
} else {
args = ['/c', cmd].concat(args);
// The /C option is capitalized to make tests work. Specifically, this
// allows to bypass an issue in https://github.com/tapjs/spawn-wrap used
// by https://github.com/istanbuljs/nyc to track code coverage.
// The problem is that `mungeCmd()` (
// https://github.com/tapjs/spawn-wrap/blob/7931ab5c/index.js#L143)
// incorrectly replaces `spawn()` args.
args = ['/C', cmd].concat(args);
cmd = 'cmd';
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -17,7 +17,7 @@
"coverage": "npm run tap -- --coverage",
"coverage-html": "npm coverage -- --coverage-report=html",
"lint": "eslint bin/* lib/ test/ --cache",
"tap": "tap -J --timeout 240 \"test/**/test-*.js\"",
"tap": "tap -J --timeout 480 \"test/**/test-*.js\"",
"test": "npm run lint && npm run tap",
"test-ci": "npm run lint && npm run coverage -- --coverage-report=lcov"
},
Expand Down
2 changes: 1 addition & 1 deletion test/test-spawn.js
Expand Up @@ -54,7 +54,7 @@ test('spawn: windows mock', (t) => {
const result = spawn('echo', ['Hello world.']);
const expected = {
cmd: 'cmd',
args: ['/c', 'echo', 'Hello world.'],
args: ['/C', 'echo', 'Hello world.'],
options: undefined
};

Expand Down

0 comments on commit a65183f

Please sign in to comment.