Skip to content

Commit

Permalink
Don't fail if the test run script doesn't exist when using Yarn
Browse files Browse the repository at this point in the history
npm exits with code 0 in this case, while Yarn exits with code 1.
  • Loading branch information
sindresorhus committed Jun 4, 2018
1 parent 3dc7069 commit 32675a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.js
Expand Up @@ -96,7 +96,13 @@ module.exports = (input, opts) => {
{
title: 'Running tests using Yarn',
enabled: () => opts.yarn === true,
task: () => exec('yarn', ['test'])
task: () => exec('yarn', ['test']).catch(err => {
if (err.message.includes('Command "test" not found')) {
return;
}

throw err;
})
}
]);
}
Expand Down

0 comments on commit 32675a3

Please sign in to comment.