Skip to content
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

Node 22 LTS breaks integration tests #518

Closed
fatso83 opened this issue Dec 9, 2024 · 1 comment
Closed

Node 22 LTS breaks integration tests #518

fatso83 opened this issue Dec 9, 2024 · 1 comment

Comments

@fatso83
Copy link
Contributor

fatso83 commented Dec 9, 2024

The latest commits fail on Node 22. They started failing on Dec 5, but it was not related to any code changes. I verified the tests failed on the code preceding that if using Node 22, with no other changes. The tests started failing due to Node 22 landing in the LTS version on October 29. Since we had no commits after Oct 29 until December, nothing was triggered.

How to reproduce
Check out main locally, choose to use Node 22 and run the tests. This is what I did (relying on ASDF and .tool-versions):

fake-timers on  main [106508?] is 📦 v13.0.5 via  v20.9.0 on ☁️  (eu-north-1) on ☁️
❯ asdf local nodejs 20.9.0

fake-timers on  main [106508?] is 📦 v13.0.5 via  v20.9.0 on ☁️  (eu-north-1) on ☁️
❯ npx mocha --timeout 200  integration-test/  -R dot --check-leaks


  ....

  4 passing (42ms)

❯ asdf local nodejs 22.12.0

fake-timers on  main [106510?] is 📦 v13.0.5 via  v22.12.0 on ☁️  (eu-north-1) on ☁️
❯ npx mocha --timeout 200  integration-test/  -R dot --check-leaks
(node:12244) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)


  ...!!

  3 passing (38ms)
  2 failing

  1) globally configured browser objects
       correctly instantiates and tears down:
     TypeError: Cannot set property navigator of #<Object> which has only a getter
      at setUpGlobal (integration-test/fake-clock-integration-test.js:91:26)
      at Context.<anonymous> (integration-test/fake-clock-integration-test.js:120:9)
      at process.processImmediate (node:internal/timers:491:21)

  2) globally configured browser objects
       correctly instantiates and tears down:
     Error: global leak(s) detected: 'window', 'document'
      at Runner.emit (node:events:536:35)
      at process.processImmediate (node:internal/timers:491:21)

@fatso83
Copy link
Contributor Author

fatso83 commented Dec 9, 2024

This is due to the introduction of a partial implementation of the Navigator API in Node 21. If listing through the keys we get this:

navigator Navigator {}
hardwareConcurrency 12
language no-NO
languages [ 'no-NO' ]
userAgent Node.js/22
platform MacIntel

I'll preserve this, delete the prop and recreate it in the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant