observablehq / plot

A concise API for exploratory data visualization implementing a layered grammar of graphics
https://observablehq.com/plot/
ISC License
4.16k stars 171 forks source link

Fix testing under node >= v21 #2067

Closed Fil closed 2 months ago

Fil commented 2 months ago

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