-
Notifications
You must be signed in to change notification settings - Fork 497
fix: update ResizeObserver and IntersectionObserver mocks for vitest v4 #11262
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: update ResizeObserver and IntersectionObserver mocks for vitest v4 #11262
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
🧪 E2E Preview environment🔑 Environment Variables for Local TestingThis is the preview URL for the E2E tests: https://e2e-studio-qk38selvm.sanity.dev To run the E2E tests locally, you can use the following environment variables, then run 💬 Remember to build the project first with |
📊 Playwright Test ReportThis report contains test results, including videos of failing tests. |
⚡️ Editor Performance ReportDeploying studio and running performance tests… |
Co-authored-by: bjoerge <[email protected]>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
1181ad4 to
bab00aa
Compare
Description
Fixes test failures caused by Vitest v4's stricter constructor mock requirements.
In Vitest v4,
vi.fn().mockReturnValue()doesn't work when the mock is invoked withnew. TheResizeObserverandIntersectionObservermocks were failing because they returned plain objects instead of being proper constructor functions.Before (broken):
After (fixed):
What to review
packages/sanity/test/setup/environment.ts- updated mock implementationsTesting
Verified locally that previously failing tests now pass (
useDocumentSheetColumns,DeletedDocumentBanners,useDocumentTitle,DocumentHeaderTitle,PaneContainer).Notes for release
Not required - internal test infrastructure change only.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.