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

Fix testing under node >= v21 #2067

Merged
merged 1 commit into from
May 27, 2024
Merged

Fix testing under node >= v21 #2067

merged 1 commit into from
May 27, 2024

Conversation

Fil
Copy link
Contributor

@Fil Fil commented May 27, 2024

Our tests do not need global.navigator, which is now present on node (https://nodejs.org/en/blog/announcements/v21-release-announce#navigator-object-integration). And, since it's only a getter, upgrading node was breaking the tests with:

TypeError: Cannot set property navigator of #<Object> which has only a getter

Note: if we needed to use jsdom.window’s navigator, we could remove node’s version by applying the following snippet: https://github.com/nodejs/node/pull/50310/files

Our tests do not need global.navigator, which is now present on node (https://nodejs.org/en/blog/announcements/v21-release-announce#navigator-object-integration). And, since it's only a getter, upgrading node was breaking the tests with:
> TypeError: Cannot set property navigator of #<Object> which has only a getter

Note: if we needed to use jsdom.window’s navigator, we could remove node’s version by applying the following snippet:
https://github.com/nodejs/node/pull/50310/files
@Fil Fil requested a review from mbostock May 27, 2024 07:51
@Fil Fil enabled auto-merge (squash) May 27, 2024 07:51
@Fil Fil merged commit eb0ca82 into main May 27, 2024
1 check passed
@Fil Fil deleted the fil/test-node-21 branch May 27, 2024 14:06
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

Successfully merging this pull request may close these issues.

None yet

2 participants