Skip to content

Commit

Permalink
Fix timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Apr 22, 2020
1 parent f41f235 commit 77a7c3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ meow(`

(async () => {
try {
await got.head('https://github.com', {timeout: 10});
await got.head('https://github.com', {
timeout: 10000,
retry: 2
});

console.error('\n 🐈 It\'s up. Go back to work!');
process.exitCode = 1;
} catch {
Expand Down
4 changes: 2 additions & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ test('main', async t => {
const {stdout} = await execa('./cli.js');
returnValue = stdout;
} catch (error) {
const {stdout} = error;
returnValue = stdout;
const {stderr} = error;
returnValue = stderr;
}

t.regex(returnValue, /down|up/);
Expand Down

0 comments on commit 77a7c3e

Please sign in to comment.