Skip to content

Commit

Permalink
squash
Browse files Browse the repository at this point in the history
  • Loading branch information
mterrel committed Dec 1, 2020
1 parent d33de2b commit dcde090
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/error.js
Expand Up @@ -74,7 +74,7 @@ test('error.shortMessage does not contain stdout/stderr', async t => {

test('Original error.message is kept', async t => {
const {originalMessage} = await t.throwsAsync(execa('noop', {cwd: 1}));
t.regex(originalMessage, /The "options.cwd" property must be of type string. Received type number/);
t.true(originalMessage.startsWith('The "options.cwd" property must be of type string. Received type number'));
});

test('failed is false on success', async t => {
Expand Down Expand Up @@ -204,10 +204,7 @@ test('error.code is undefined on success', async t => {
t.is(code, undefined);
});

// Windows doesn't throw ENOENT on invalid command
if (process.platform !== 'win32') {
test('error.code is defined on failure if applicable', async t => {
const {code} = await t.throwsAsync(execa('invalid'));
t.is(code, 'ENOENT');
});
}
test('error.code is defined on failure if applicable', async t => {
const {code} = await t.throwsAsync(execa(''));
t.is(code, 'ERR_INVALID_ARG_VALUE');
});

0 comments on commit dcde090

Please sign in to comment.