Skip to content

Commit

Permalink
Fix Windows test related to shell option (#185)
Browse files Browse the repository at this point in the history
Fixes #56

Using shabangs on Windows currently only works in non-shell mode, but not in shell mode (when `shell` option is either `true` or a string). This is [done through `cross-spawn`](https://github.com/moxystudio/node-cross-spawn/blob/master/lib/parse.js#L32). I think the current behavior is the correct behavior.

The original test failed because it tried to fire a shabang with `cmd.exe`. Instead I've fired the binary through `node` which works.
  • Loading branch information
ehmicky authored and sindresorhus committed Mar 6, 2019
1 parent 6513984 commit eac23b0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test.js
Expand Up @@ -438,10 +438,8 @@ if (process.platform !== 'win32') {
test('cleanup false - SIGKILL', spawnAndKill, 'SIGKILL', false);
}

// See: https://github.com/sindresorhus/execa/issues/56
const onlyWinFailing = test[process.platform === 'win32' ? 'failing' : 'serial'];
onlyWinFailing('execa.shell() supports the `shell` option', async t => {
const {stdout} = await m.shell('noop foo', {
test('execa.shell() supports the `shell` option', async t => {
const {stdout} = await m.shell('node fixtures/noop foo', {
shell: process.platform === 'win32' ? 'cmd.exe' : '/bin/bash'
});
t.is(stdout, 'foo');
Expand Down

0 comments on commit eac23b0

Please sign in to comment.