You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importnockfrom"nock";importpathfrom"node:path";constnockArtefacts=path.resolve("tests/artefacts/nock");constnockBack=nock.back;describe("fetchData",async()=>{before(()=>{nockBack.fixtures=nockArtefacts;nockBack.setMode("lockdown");});it("should successfully fetch the user data JSON object",async()=>{constfetcher=newFetchStatuses(testPassFQDN,testPassUserId);assert.equal(fetcher.fetchedStatusData,null);const{ nockDone }=awaitnockBack("user-statuses.json");awaitfetcher.fetchData();nockDone();assert.notEqual(fetcher.fetchedStatusData,null);});});
I ran Nock's tests using Node v23, and they were successful. Could you please share a more straightforward example? something I can easily run online or on my computer without unnecessary external dependencies.
Please avoid duplicates
Reproducible test case
Apologies for not creating a RunKit working example, I wasn't sure how to do that with recording of fixtures.
Nock Version
[email protected]
Node Version
v23.2.0
TypeScript Version
No response
What happened?
I'm using NockBack in lockdown mode as part of my test suite. I'm using the beta version because I want to use native fetch.
My test suite started to fail with the release of [email protected]
The parsing of the recorded artefact fails.
The reported error is a
Z_DATA_ERROR
with the below stack trace:I've tried deleting and re-creating the fixtures without success.
My code to use the native
fetch
looks like this:My test looks like this:
The exact same code works as expected with [email protected]
I'm keen to help in any way that I can.
Would you be interested in contributing a fix?
The text was updated successfully, but these errors were encountered: