-
-
Notifications
You must be signed in to change notification settings - Fork 754
Closed
Labels
Description
Please avoid duplicates
- I checked all open bugs and none of them matched my problem.
Reproducible test case
Can't import @beta or @14.0.0-beta.19 in RunKit, sorry :(
Nock Version
beta, 14.0.0-beta.19
Node Version
22 and 23
TypeScript Version
No response
What happened?
- Setup a simple nock (tested directly in project on branch beta)
- Use native
fetchwith simple GET - Clone the response
- URL should be set.
describe('Native Fetch', () => {
it('clones all', async () => {
const scope = nock('http://example.test').get('/').reply()
const response = await fetch('http://example.test/')
const clonedResponse = response.clone();
expect(clonedResponse).to.equal(response);
scope.done()
})
}I'm not sure how nock handles things exactly under the hood whether it offloads stuff to some other library for it.
Testing the same directly in node results in url being set correctly for both original and cloned response.
I found this when trying to make @apollo/datasource-rest use native fetch/undici.fetch instead of node-fetch.
Would you be interested in contributing a fix?
- yes
Reactions are currently unavailable
