Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

got-fetch ignores retry setting of extended got #358

Open
golyshevd opened this issue Jul 4, 2023 · 1 comment
Open

got-fetch ignores retry setting of extended got #358

golyshevd opened this issue Jul 4, 2023 · 1 comment

Comments

@golyshevd
Copy link

golyshevd commented Jul 4, 2023

Test case:

it.only('Should support retries', async () => {
      nock('https://unstable.com')
        .get('/v1/unstable')
        .times(1)
        .reply(StatusCodes.INTERNAL_SERVER_ERROR)
        .get('/v1/unstable')
        .times(1)
        .reply(StatusCodes.OK);

      const fetch = createFetch(
        got.extend({
          retry: {
            limit: 5,
            methods: ['GET'],
          },
        })
      );

      const { status } = await fetch('https://unstable.com/v1/unstable', {
        method: 'GET',
      });

      expect(status).toEqual(StatusCodes.OK);
    });

Is fails like this:

    createFetch
      ✕ Should support retries (16 ms)

  ● RestDataSource › createFetch › Should support retries

    expect(received).toEqual(expected) // deep equality

    Expected: 200
    Received: 500

      85 |       });
      86 |
    > 87 |       expect(status).toEqual(StatusCodes.OK);
         |                      ^
      88 |     });
      89 |   });
      90 | });
@2snEM6
Copy link

2snEM6 commented Nov 20, 2023

I confirm this happens to me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants