Skip to content

Commit

Permalink
Fix tests for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 10, 2019
1 parent 465f89e commit 13f49f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test.js
Expand Up @@ -117,7 +117,7 @@ test('execa.sync()', t => {
test('execa.sync() throws error if written to stderr', t => {
t.throws(() => {
execa.sync('foo');
}, process.platform === 'win32' ? /'foo' is not recognized as an internal or external command/ : /spawnSync foo ENOENT/);
}, process.platform === 'win32' ? /Command failed with exit code 1/ : /spawnSync foo ENOENT/);
});

test('skip throwing when using reject option in execa.sync()', t => {
Expand All @@ -137,7 +137,7 @@ test('stripFinalNewline option', async t => {

test('preferLocal option', async t => {
await execa('ava', ['--version'], {env: {PATH: ''}});
const errorRegExp = process.platform === 'win32' ? /not recognized/ : /spawn ava ENOENT/;
const errorRegExp = process.platform === 'win32' ? /Command failed with exit code 1/ : /spawn ava ENOENT/;
await t.throwsAsync(execa('ava', ['--version'], {preferLocal: false, env: {PATH: ''}}), errorRegExp);
});

Expand Down

0 comments on commit 13f49f3

Please sign in to comment.