-
Notifications
You must be signed in to change notification settings - Fork 338
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
Support develoment environment using Node.js 20 #2917
Comments
For failures for util.submit-addon, this change works for me: diff --git tests/unit/test-util/test.submit-addon.js tests/unit/test-util/test.submit-addon.js
index 7085072..faa327f 100644
--- tests/unit/test-util/test.submit-addon.js
+++ tests/unit/test-util/test.submit-addon.js
@@ -29,7 +29,7 @@ class JSONResponse extends Response {
const mockNodeFetch = (nodeFetchStub, url, method, responses) => {
const stubMatcher = nodeFetchStub.withArgs(
- url instanceof URL ? url : new URL(url),
+ sinon.match((value) => (value instanceof URL && value.href === (url instanceof URL ? url.href : url))),
sinon.match.has('method', method),
);
for (let i = 0; i < responses.length; i++) { It seems matching URLs in sinon stubs is tricky with Node.js 20. There are some other reports about URLs (sinonjs/sinon#2527, nodejs/node#48886), and a Node.js developer suggested comparing the href attribute. Here is a test script using sinon stubs with URLs. The result becomes unexpected with Node.js 20.
|
The URL issue in Node.js was allegedly resolved in 18.18: nodejs/node#48886 (comment) The associated PR (nodejs/node#48897) claims that the bug was backported to 18.18.0 and 20.6.0. The landed commit is also on the v21.0.0 branch. So I think that the test should pass without issues. I'll create a PR with a version bump to get a test run. |
Thank you for the update. I guess test failures related to util.submit-addon are caused by an issue different from nodejs/node#48886. I mentioned it because my "fix" was imspired by a comment there. Sorry if that's confusing. Also, after fixing test failures around URLs, there are many other failures on newer Node.js. |
Is this a feature request or a bug?
A feature request
What is the current behavior?
Similar to #2564, I was testing if web-ext works with the latest Node.js or not, and noticed many tests failed
test failures
What is the expected or desired behavior?
web-ext works fine on Node.js 20.x and all tests pass.
Version information (for bug reports)
Logs are from git-master (08c5cd9). The issue also occurs for 7.8.0.
The text was updated successfully, but these errors were encountered: