build(deps-dev): bump nock from 13.5.6 to 14.0.0#2182
build(deps-dev): bump nock from 13.5.6 to 14.0.0#2182dependabot[bot] wants to merge 1 commit intomainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dependabot[bot] The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@cjihrig test failiures appear to be related to: We are trying to simulate a socket error part-way through a watch, I think that we need to modify that code, I played around with it some but I couldn't (yet) figure out the right way to simulate it with the new stack. I'll keep trying, but if you have any ideas, that'd be great too. |
|
Yea, I had this on my list of things to look into. I'll move it up the list 😄 I'm pretty certain we will need to make some changes to this code anyway. These two tests are also causing problems updating to node-fetch v3 (and presumably native fetch in the future). I wrote up my findings on that in #2146 (comment). |
|
Bisecting nock releases points to v14.0.0-beta.8, which only has one commit (unfortunately a complex one): nock/nock#2517 Looking more closely at that particular release, and the v14.0.0 release, it appears that a new mock implementation was swapped in under the hood. There were a number of tests moved into a skipped state to address edge cases - maybe this is one of those edge cases. |
|
@dependabot rebase (I'm hopeful that the update to fetch v3 comparability will fix this) |
Bumps [nock](https://github.com/nock/nock) from 13.5.6 to 14.0.0. - [Release notes](https://github.com/nock/nock/releases) - [Changelog](https://github.com/nock/nock/blob/main/CHANGELOG.md) - [Commits](nock/nock@v13.5.6...v14.0.0) --- updated-dependencies: - dependency-name: nock dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
065f89b to
6076633
Compare
It won't. The tests won't timeout anymore, but the expected errors will be |
|
I created a reduced reproduction of the issue to share with the nock team: import assert from 'node:assert';
import { createInterface } from 'node:readline';
import { PassThrough } from 'node:stream';
import fetch from 'node-fetch';
import nock from 'nock';
const stream = new PassThrough();
const expectedErr = new Error('boom!');
let response;
const scope = nock('http://foo.com');
const s = scope
.get('/bar')
.reply(200, function() {
this.req.on('response', (r) => {
response = r;
});
stream.push(JSON.stringify({ name: 'obj1' }) + '\n');
stream.push(JSON.stringify({ name: 'obj2' }) + '\n');
return stream;
});
const res = await fetch('http://foo.com/bar');
assert.strictEqual(res.status, 200);
const waitForLines = Promise.withResolvers();
const waitForError = Promise.withResolvers();
const lines = [];
let actual;
const readline = createInterface(res.body);
readline.on('error', (err) => {
actual = err;
waitForError.resolve();
});
readline.on('line', (line) => {
lines.push(line);
if (lines.length === 2) {
waitForLines.resolve();
}
});
await waitForLines.promise;
assert.deepStrictEqual(lines, [
JSON.stringify({ name: 'obj1' }),
JSON.stringify({ name: 'obj2' }),
]);
response.destroy(expectedErr);
await waitForError.promise;
assert.strictEqual(actual, expectedErr);
console.log('done!');I tested this with Node 23.7.0 and node-fetch@3.3.2, which are both the latest at the time of writing. With nock@14.0.0-beta.7 and nock@13.5.6 (latest 13x release), this completes successfully. With nock@14.0.0-beta.8 (where I believe the break was introduced) and nock@14.0.0, this does not complete successfully because the |
|
Superseded by #2207. |
Bumps nock from 13.5.6 to 14.0.0.
Release notes
Sourced from nock's releases.
Commits
ef3f158feat: support for nativefetch(#2813)c8b2b22Fix: GitHub workflow script injection (#2805)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebasewill rebase this PR@dependabot recreatewill recreate this PR, overwriting any edits that have been made to it@dependabot mergewill merge this PR after your CI passes on it@dependabot squash and mergewill squash and merge this PR after your CI passes on it@dependabot cancel mergewill cancel a previously requested merge and block automerging@dependabot reopenwill reopen this PR if it is closed@dependabot closewill close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditionswill show all of the ignore conditions of the specified dependency@dependabot ignore this major versionwill close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor versionwill close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependencywill close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)