Conversation
- Replace happy-dom with jsdom (^27.1.0) for better DOM compatibility - Add @vitest/eslint-plugin (^1.4.0) with legacy-recommended preset - Add vitest/globals types to test tsconfig files to fix TypeScript errors - Update all vitest configs to use jsdom environment - Fix TooltipWithBounds test for jsdom style computation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the project's testing environment from happy-dom to jsdom (version 27.1.0) to improve DOM compatibility and testing reliability. The migration includes adding ESLint support for Vitest, fixing TypeScript configurations, and updating test expectations to accommodate jsdom's different style handling behavior.
Key Changes
- Replaced
happy-dom@14withjsdom@^27.0.0as the DOM testing environment - Added
@vitest/eslint-plugin@^1.4.0with the legacy-recommended preset for better test linting - Updated all vitest configuration files across 30+ packages to use jsdom instead of happy-dom
- Fixed CSS padding values to use explicit decimal notation for cross-environment consistency
Reviewed Changes
Copilot reviewed 73 out of 74 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| package.json | Replaced happy-dom with jsdom, added vitest ESLint plugin |
| .eslintrc.js | Added @vitest plugin configuration for test files |
| yarn.lock | Added jsdom and all transitive dependencies, removed happy-dom |
| vitest.config.ts (all packages) | Changed test environment from 'happy-dom' to 'jsdom' |
| test/tsconfig.json (all packages) | Added vitest/globals type declarations |
| Tooltip.tsx | Changed padding shorthand to explicit decimal notation |
| TooltipWithBounds.test.tsx | Updated test assertions to handle jsdom's style computation |
| Tooltip.test.tsx | Updated padding expectation to explicit decimal notation |
Comments suppressed due to low confidence (1)
packages/visx-tooltip/test/Tooltip.test.tsx:21
- Using 'as any' bypasses TypeScript's type safety. Consider using a more specific type assertion like
tooltip.style[key as keyof React.CSSProperties]or defining a proper type guard to ensure type safety while accessing style properties.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Size Changes
View raw build statsPrevious (master){
"visx-annotation": {
"esm": 30333,
"lib": 40419
},
"visx-axis": {
"esm": 20709,
"lib": 25153
},
"visx-bounds": {
"esm": 2662,
"lib": 3136
},
"visx-brush": {
"esm": 55826,
"lib": 60097
},
"visx-chord": {
"esm": 3301,
"lib": 4484
},
"visx-clip-path": {
"esm": 3993,
"lib": 5491
},
"visx-curve": {
"esm": 323,
"lib": 1462
},
"visx-delaunay": {
"esm": 2422,
"lib": 3231
},
"visx-demo": {
"esm": 0,
"lib": 0
},
"visx-drag": {
"esm": 12570,
"lib": 14176
},
"visx-event": {
"esm": 3815,
"lib": 5091
},
"visx-geo": {
"esm": 12930,
"lib": 16196
},
"visx-glyph": {
"esm": 13761,
"lib": 18476
},
"visx-gradient": {
"esm": 16078,
"lib": 20593
},
"visx-grid": {
"esm": 18164,
"lib": 22188
},
"visx-group": {
"esm": 1471,
"lib": 2070
},
"visx-heatmap": {
"esm": 7040,
"lib": 8347
},
"visx-hierarchy": {
"esm": 12093,
"lib": 17820
},
"visx-legend": {
"esm": 25964,
"lib": 32892
},
"visx-marker": {
"esm": 8204,
"lib": 10332
},
"visx-mock-data": {
"esm": 326036,
"lib": 329336
},
"visx-network": {
"esm": 4544,
"lib": 6634
},
"visx-pattern": {
"esm": 11689,
"lib": 15673
},
"visx-point": {
"esm": 1003,
"lib": 1781
},
"visx-react-spring": {
"esm": 13221,
"lib": 16485
},
"visx-responsive": {
"esm": 15936,
"lib": 18296
},
"visx-sankey": {
"esm": 3543,
"lib": 4594
},
"visx-scale": {
"esm": 19205,
"lib": 30251
},
"visx-shape": {
"esm": 81787,
"lib": 102594
},
"visx-stats": {
"esm": 13498,
"lib": 15050
},
"visx-text": {
"esm": 8297,
"lib": 9794
},
"visx-threshold": {
"esm": 2844,
"lib": 3723
},
"visx-tooltip": {
"esm": 14383,
"lib": 19715
},
"visx-vendor": {
"esm": 2492,
"lib": 2702
},
"visx-visx": {
"esm": 1524,
"lib": 4155
},
"visx-voronoi": {
"esm": 2137,
"lib": 2824
},
"visx-wordcloud": {
"esm": 2506,
"lib": 3324
},
"visx-xychart": {
"esm": 174768,
"lib": 225877
},
"visx-zoom": {
"esm": 16176,
"lib": 18872
}
}Current{
"visx-annotation": {
"esm": 30333,
"lib": 40419
},
"visx-axis": {
"esm": 20709,
"lib": 25153
},
"visx-bounds": {
"esm": 2662,
"lib": 3136
},
"visx-brush": {
"esm": 55826,
"lib": 60097
},
"visx-chord": {
"esm": 3301,
"lib": 4484
},
"visx-clip-path": {
"esm": 3993,
"lib": 5491
},
"visx-curve": {
"esm": 323,
"lib": 1462
},
"visx-delaunay": {
"esm": 2422,
"lib": 3231
},
"visx-demo": {
"esm": 0,
"lib": 0
},
"visx-drag": {
"esm": 12570,
"lib": 14176
},
"visx-event": {
"esm": 3815,
"lib": 5091
},
"visx-geo": {
"esm": 12930,
"lib": 16196
},
"visx-glyph": {
"esm": 13761,
"lib": 18476
},
"visx-gradient": {
"esm": 16078,
"lib": 20593
},
"visx-grid": {
"esm": 18164,
"lib": 22188
},
"visx-group": {
"esm": 1471,
"lib": 2070
},
"visx-heatmap": {
"esm": 7040,
"lib": 8347
},
"visx-hierarchy": {
"esm": 12093,
"lib": 17820
},
"visx-legend": {
"esm": 25964,
"lib": 32892
},
"visx-marker": {
"esm": 8204,
"lib": 10332
},
"visx-mock-data": {
"esm": 326036,
"lib": 329336
},
"visx-network": {
"esm": 4544,
"lib": 6634
},
"visx-pattern": {
"esm": 11689,
"lib": 15673
},
"visx-point": {
"esm": 1003,
"lib": 1781
},
"visx-react-spring": {
"esm": 13221,
"lib": 16485
},
"visx-responsive": {
"esm": 15936,
"lib": 18296
},
"visx-sankey": {
"esm": 3543,
"lib": 4594
},
"visx-scale": {
"esm": 19205,
"lib": 30251
},
"visx-shape": {
"esm": 81787,
"lib": 102594
},
"visx-stats": {
"esm": 13498,
"lib": 15050
},
"visx-text": {
"esm": 8297,
"lib": 9794
},
"visx-threshold": {
"esm": 2844,
"lib": 3723
},
"visx-tooltip": {
"esm": 14385,
"lib": 19717
},
"visx-vendor": {
"esm": 2492,
"lib": 2702
},
"visx-visx": {
"esm": 1524,
"lib": 4155
},
"visx-voronoi": {
"esm": 2137,
"lib": 2824
},
"visx-wordcloud": {
"esm": 2506,
"lib": 3324
},
"visx-xychart": {
"esm": 174768,
"lib": 225877
},
"visx-zoom": {
"esm": 16176,
"lib": 18872
}
} |
|
Pinned jsdom to |
|
🎉 This PR is included in version |
🏠 Internal