Skip to content

fix(test): suppress vite swc and jsdom scrollTo warnings#1884

Merged
samuv merged 2 commits intomainfrom
update-test-setup
Mar 31, 2026
Merged

fix(test): suppress vite swc and jsdom scrollTo warnings#1884
samuv merged 2 commits intomainfrom
update-test-setup

Conversation

@samuv
Copy link
Copy Markdown
Collaborator

@samuv samuv commented Mar 31, 2026

Changes:

  • Replace @vitejs/plugin-react-swc with @vitejs/plugin-react in vitest.config.ts and renderer/vite.renderer.config.ts. No SWC plugins were configured, so Vite/Rolldown recommends using the lighter plugin.
  • Stub window.scrollTo in vitest.setup.ts alongside the existing jsdom stubs (scrollIntoView, hasPointerCapture, etc.) to silence the "Not implemented: Window's scrollTo() method" noise in test output.

@samuv samuv self-assigned this Mar 31, 2026
Copilot AI review requested due to automatic review settings March 31, 2026 08:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces test/build noise by switching the React Vite plugin from the SWC variant to the standard plugin (since no SWC-specific configuration is used), and by stubbing window.scrollTo in the Vitest JSDOM environment to silence the “Not implemented” warning.

Changes:

  • Replace @vitejs/plugin-react-swc with @vitejs/plugin-react in Vite/Vitest configs.
  • Stub window.scrollTo in vitest.setup.ts to suppress JSDOM “Not implemented” output.
  • Update dependencies/lockfile accordingly (removing @swc/core packages).

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
vitest.setup.ts Adds a window.scrollTo stub alongside existing JSDOM stubs to silence warnings during tests.
vitest.config.ts Switches Vitest’s Vite plugin from plugin-react-swc to plugin-react.
renderer/vite.renderer.config.ts Switches renderer Vite config from plugin-react-swc to plugin-react.
package.json Replaces the devDependency on @vitejs/plugin-react-swc with @vitejs/plugin-react.
pnpm-lock.yaml Lockfile updates reflecting the plugin swap and removal of SWC-related packages.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@samuv samuv enabled auto-merge (squash) March 31, 2026 08:32
@samuv samuv merged commit b05f89f into main Mar 31, 2026
21 checks passed
@samuv samuv deleted the update-test-setup branch March 31, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants