fix(test): patch more paths in test build#353
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances the test build script to handle additional import path mappings for the @voidzero-dev/vite-plus-test package. The changes enable the package to work as a drop-in replacement for vitest by mapping both vitest/* and @voidzero-dev/vite-plus-test/* imports to the appropriate bundled files.
Key changes:
- Added comprehensive subpath mapping for
vitest/*imports (node, config, internal/browser, runners, suite, etc.) to resolve to dist files - Added support for
@voidzero-dev/vite-plus-test/*subpaths to be treated as equivalent tovitest/*imports - Patched BrowserContext plugin to recognize
@voidzero-dev/vite-plus-test/browseras an alias for the vitest browser context
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Document the enhanced vendor-aliases plugin capabilities: - vitest/browser-playwright now works when vitest is overridden - @voidzero-dev/vite-plus-test/* subpaths are supported - Clarify the two config file import options 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Added support for `@voidzero-dev/vite-plus/test/*` subpath imports in addition to existing `vitest/*` and `@voidzero-dev/vite-plus-test/*` patterns. All three import patterns now work: - `vitest/browser-playwright` (Recommended, requires vitest override) - `@voidzero-dev/vite-plus-test/browser-playwright` (direct test package) - `@voidzero-dev/vite-plus/test/browser-playwright` (direct CLI package) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
cursor review |
|
@codex review |
Convert warnings to errors for critical patches in patchVitestBrowserPackage: - vendor-aliases plugin injection - exclude list patching - BrowserContext alias patching This ensures build fails immediately if vitest code changes break our patches, rather than producing confusing runtime errors for users. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Brooooooklyn
left a comment
There was a problem hiding this comment.
Re: cursor bot comment about missing vitest/browser-playwright - This is a false positive.
The vitestSubpathMap is for browser-side resolution in the vendor-aliases plugin. But vitest/browser-playwright is ONLY imported in vite.config.ts files (Node.js context), not in browser code.
The tester chunk only imports vitest/browser:
import { userEvent, page, server } from 'vitest/browser';Config-time imports are resolved by Node.js via pnpm overrides and package.json exports, not by the vendor-aliases plugin.
Re: @fengmk2 comment - Fixed! Changed warnings to throw errors for all critical patches in patchVitestBrowserPackage. Now the build will fail immediately if vitest code changes break our patches, rather than producing confusing runtime errors.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
cursor review |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|

Note
Adds WebdriverIO and Preview providers to the bundled test package, generalizes build patches (imports, types, locators), extends exports, and updates docs and blocklists.
browser-playwright,browser-webdriverio,browser-preview)..jsand.d.ts; add creation ofbrowser/entry files (context.js/.d.ts).*.d.tsfrom@vitest/*(e.g.,context.d.ts,matchers.d.ts,jest-dom.d.ts).vendor-aliasesplugin: handlevitest/*and package aliases; add virtualvitest/browser; throw on missing patch points.EXTERNAL_BLOCKLISTto includewebdriverio.browser-webdriverioandbrowser-previewin both test and CLI packages.browser-playwright-contextplugin export withbrowser-webdriverioandbrowser-preview.@vitest/browser-*providers from peer deps (now bundled); keep@vitest/uioptional.@vitest/browser-webdriverioand@vitest/browser-preview.Written by Cursor Bugbot for commit 5319309. This will update automatically on new commits. Configure here.