Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

📝 Summary

Updates vitest from v3.2.4 to v4.0.14 and fixes breaking changes in mock/constructor behavior.

🔍 Description of Changes

Vitest v4 changed how vi.fn().mockImplementation() works with new - function mocks no longer support constructor calls. This broke several test mocks.

Fixes:

  • Constructor mocks - Replaced vi.fn().mockImplementation() with actual class definitions for:

    • Notification mock in dynamic-favicon.test.tsx
    • WebSocket mock in waitForWs.test.ts
    • ClipboardItem mock in common.ts
  • JSON.rawJSON compatibility - Added fallback in json-parser.ts for Node 20 environments where JSON.rawJSON isn't available (Node 21+ only)

Before (broken in v4):

global.WebSocket = vi.fn().mockImplementation(() => ({
  close: vi.fn(),
  onopen: null,
}));

After:

class MockWebSocket {
  close = vi.fn();
  onopen: (() => void) | null = null;
  constructor(_url: string) { mockInstances.push(this); }
}
global.WebSocket = MockWebSocket as unknown as typeof WebSocket;

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.

💡 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.

@vercel
Copy link

vercel bot commented Dec 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Dec 2, 2025 8:32pm

Co-authored-by: mscolnick <2753772+mscolnick@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Dec 2, 2025


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

Co-authored-by: mscolnick <2753772+mscolnick@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 2, 2025

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:

  • example.com
    • Triggering command: /usr/local/bin/node /usr/local/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/marimo/marimo/node_modules/.pnpm/vitest@4.0.15_@opentelemetry&#43;api@1.9.0_@types&#43;node@24.10.1_esbuild@0.25.9_jiti@2.6.1_js_22adc03545082b1ad035e4488b6e1ff3/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/marimo/marimo/node_modules/.pnpm/vitest@4.0.15_@opentelemetry&#43;api@1.9.0_@types&#43;node@24.10.1_esbuild@0.25.9_jiti@2.6.1_js_22adc03545082b1ad035e4488b6e1ff3/node_modules/vitest/dist/workers/forks.js (dns block)
  • marimo.app
    • Triggering command: /usr/local/bin/node /usr/local/bin/node --conditions node --conditions development --experimental-import-meta-resolve --require /home/REDACTED/work/marimo/marimo/node_modules/.pnpm/vitest@4.0.15_@opentelemetry&#43;api@1.9.0_@types&#43;node@24.10.1_esbuild@0.25.9_jiti@2.6.1_js_22adc03545082b1ad035e4488b6e1ff3/node_modules/vitest/suppress-warnings.cjs /home/REDACTED/work/marimo/marimo/node_modules/.pnpm/vitest@4.0.15_@opentelemetry&#43;api@1.9.0_@types&#43;node@24.10.1_esbuild@0.25.9_jiti@2.6.1_js_22adc03545082b1ad035e4488b6e1ff3/node_modules/vitest/dist/workers/forks.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Update dependency vitest to version 4.0.14 chore(deps): update dependency vitest to v4 Dec 2, 2025
Copilot AI requested a review from mscolnick December 2, 2025 20:38
@mscolnick mscolnick marked this pull request as ready for review December 2, 2025 22:01
@renovate renovate bot force-pushed the renovate/major-testing-dependencies branch 2 times, most recently from d832a93 to 997192b Compare December 5, 2025 17:51
@renovate renovate bot force-pushed the renovate/major-testing-dependencies branch 2 times, most recently from ad7b719 to e08a1a1 Compare December 19, 2025 15:37
@renovate renovate bot force-pushed the renovate/major-testing-dependencies branch 3 times, most recently from 81ccb1e to 51a19d3 Compare January 5, 2026 14:44
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.

2 participants