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

Not compatible with TS/Nock #959

Closed
mwdewey opened this issue Dec 3, 2019 · 1 comment
Closed

Not compatible with TS/Nock #959

mwdewey opened this issue Dec 3, 2019 · 1 comment

Comments

@mwdewey
Copy link

mwdewey commented Dec 3, 2019

Running into an issue with the new version of Got. When trying to intercept requests with Nock, it will throw this error:

RequestError: Making a request with empty 'options' is not supported in Nock
GotError: Making a request with empty 'options' is not supported in Nock

This is the whole test case file:

import got from 'got';
import nock from 'nock';

it('test', async () => {
    nock('https://google.com')
        .get('/')
        .reply(200, [{test: 'test'}]);

    const response = await got
        .get('https://google.com/');

    console.log(response.body);
});

Downgrading Got to version 9 fixes the issue. I'm not sure what is causing the problem.

Here is a bare minimum repo that has my configurations for duplicating the error.
https://github.com/mwdewey/gottest

Using:
Node 10.16.1
Got 10.0.1 (latest)
Nock 11.7.0 (latest)
Jest 24.9.0 (latest)

@szmarczak
Copy link
Collaborator

I can't reproduce: https://runkit.com/szmarczak/5de68bc3c08e9d001dc1ca55

I think that's Jest. It's being already discussed in #876

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