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 acbaece
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion index.js
Expand Up @@ -96,7 +96,15 @@ module.exports = (input, opts) => {
{
title: 'Running tests using Yarn',
enabled: () => opts.yarn === true,
task: () => exec('yarn', ['test'])
task: () => exec('yarn', ['test']).pipe(
catchError(err => {
if (err.message.includes('Command "test" not found')) {
return [];
}

throwError(err);
})
)
}
]);
}
Expand Down

0 comments on commit acbaece

Please sign in to comment.