Skip to content
Myr

Fix Windows test related to `shell` option (#185)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

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.

authored by ehmicky · committed by Sindre Sorhus · parent 6513984 · Browse files · 1 file+2 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−4 removed

  • other:+2 added−4 removed

1 file+2 added−4 removed

modified:test.js+2 added-4 removed
436 unmodified lines
437 test('cleanup false - SIGINT', spawnAndKill, 'SIGTERM', false);438 test('cleanup false - SIGKILL', spawnAndKill, 'SIGKILL', false);439}440441// See: https://github.com/sindresorhus/execa/issues/56442const onlyWinFailing = test[process.platform === 'win32' ? 'failing' : 'serial'];443onlyWinFailing('execa.shell() supports the `shell` option', async t => {444 const {stdout} = await m.shell('noop foo', {441test('execa.shell() supports the `shell` option', async t => {442 const {stdout} = await m.shell('node fixtures/noop foo', {443 shell: process.platform === 'win32' ? 'cmd.exe' : '/bin/bash'444 });445 t.is(stdout, 'foo');446});
109 unmodified lines