Skip to content

Commit

Permalink
Remove not needed timeouts in test/retry.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
szmarczak committed Nov 2, 2019
1 parent 63cb1b2 commit f07f9f9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/retry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ const handler413 = (_request, response) => {
response.end();
};

test('works on timeout error', withServer, async (t, server, got) => {
// TODO: this should use lolex
test('works on timeout', withServer, async (t, server, got) => {
let knocks = 0;
server.get('/', (_request, response) => {
if (knocks++ === 1) {
Expand All @@ -26,6 +27,7 @@ test('works on timeout error', withServer, async (t, server, got) => {
t.is((await got({timeout: {socket: socketTimeout}})).body, 'who`s there?');
});

// TODO: this should use lolex
test('setting to `0` disables retrying', withServer, async (t, server, got) => {
let trys = 0;
server.get('/', () => {
Expand All @@ -51,7 +53,6 @@ test('retry function gets iteration count', withServer, async (t, server, got) =
});

await got({
timeout: {socket: socketTimeout},
retry: {
calculateDelay: ({attemptCount}) => {
t.true(is.number(attemptCount));
Expand All @@ -61,6 +62,7 @@ test('retry function gets iteration count', withServer, async (t, server, got) =
});
});

// TODO: this should use lolex
test('falsy value prevents retries', withServer, async (t, server, got) => {
server.get('/', () => {});

Expand Down

0 comments on commit f07f9f9

Please sign in to comment.