-
-
Notifications
You must be signed in to change notification settings - Fork 739
Release version 14 #2813
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
Release version 14 #2813
Conversation
BREAKING CHANGE: drop support for Node < 18
* fix: replace debug module with node builtin debug * update readme * use %s instead of %o * remove comment * use %s instead of %o * add test * fix
Bumps [sinon](https://github.com/sinonjs/sinon) from 15.2.0 to 17.0.1. - [Release notes](https://github.com/sinonjs/sinon/releases) - [Changelog](https://github.com/sinonjs/sinon/blob/main/docs/changelog.md) - [Commits](sinonjs/sinon@v15.2.0...v17.0.1) --- updated-dependencies: - dependency-name: sinon dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Michael Solomon <micheal540@gmail.com>
* fix:mapValues should not modify object in place * test:add tests to ensure objects are not modified
* fix: remove unused setInterval spy * fix: delete timer references after callback This way we don't hold any strong reference to potentially large setTimeout/setImmediate contexts any more. Since we use neither `clearTimeout`, nor `clearImmediate`, we can just ignore those cases and don't need to install spies to handle deliberate clears.
🎉 This PR is included in version 14.0.0-beta.19 🎉 The release is available on: Your semantic-release bot 📦🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feel free to merge at your own discretion 🚀
I can also merge it if you like. We should use rebase & merge to make sure we get the commits, and make sure there is a |
@gr2m I'd love to get your help with this, as in not very familiar with this process. |
Okay the process is as follows
We can manually update the changelog to be more easily be used as an upgrade guide. Happy to do it and watch the release in case something goes wrong. Just let me know if you like me to do it a certain day/time |
@gr2m I see..
I believe we're ready. Please feel free to merge this whenever you have the time. :) |
@gr2m no pressure, just curious if you have some time soon to release this. |
Looking into it now |
🎉 This PR is included in version 14.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
There we go! Feel free to update the release notes with more detail as you see fit. |
I really appreciate all the amazing work you and other contributors put into it. I don't have the mental space and time to give all your work its due credit but I will once things get better for me. Open Source at its best, thank you <3 |
I couldn't have done this without your openness and warm welcome 🙏 |
@mikicho this appears to have broken some logic that we were using to simulate a failure halfway through a response (e.g. body stream gets broken/disconnected halfway through responding) Is there a good way to do this with the new approach to fetch response integration? Thanks! |
@brendandburns Can you please create an issue with minimal reproduction of the error you get? |
@mikicho please see kubernetes-client/javascript#2182 (comment) for a reproduction using only nock, the latest node-fetch, and Node core modules. It's only about 50 lines of code. The issue seems to be |
Pasting the repro from @cjihrig here, just for simplicity: 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!'); |
Is there a migration guide or list of backwards-incompatible changes for Nock v14? I'm trying to upgrade and running into some errors that I am not seeing issues about. I am happy to dive in and create a good reproduction, but if it's just that I haven't made some change on my end that would be good to know. The errors all look like this, for what it's worth:
|
@glasser There is no migration guide for version 14, as it aims to maintain the same API and behavior as much as possible. All the differences are documented in this PR description: #2813 (comment).
If you think this is a bug, please open an issue with a simple reproduction. |
We moved to
mswjs/interceptors
as interception logic. Separation of the interception and mocking logic will enable us to maintain high-quality interception code across Node and focus on mocking features.As part of the migration, we increased our compatibility with Node.js significantly:
Regressions
delayConnection
I skipped a few failing tests that I plan to fix as part of the interception logic cleanup and refresh I want to do for
nock
.CC @nock/maintainers