Repository navigation
fix(runtime): test failure when module cached #1856
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
Changes from all commits
3602fd9
91a77dc
72b9768
25b5eeb
ef6d7ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,15 +24,15 @@ export const NuxtRootStubPlugin = (options: NuxtRootStubPluginOptions): Plugin = | |
| filter: { | ||
| id: idFilter, | ||
| }, | ||
| async handler(id, importer) { | ||
| return importer?.endsWith('index.html') ? id : entryPath | ||
| handler() { | ||
| return entryPath | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Restrict resolution to the root-stub request.
🤖 Prompt for AI Agents |
||
| }, | ||
| }, | ||
| load: { | ||
| filter: { | ||
| id: idFilter, | ||
| }, | ||
| async handler() { | ||
| handler() { | ||
| const entryContents = readFileSync(options.entry, 'utf-8') | ||
| return entryContents.replace('#build/root-component.mjs', options.rootStubPath) | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import type { TestProject } from 'vitest/node' | ||
|
|
||
| export default function setup(project: TestProject) { | ||
| project.provide('testPattern', process.env.ERROR_TEST_PATTERN) | ||
| } | ||
|
|
||
| declare module 'vitest' { | ||
| export interface ProvidedContext { | ||
| testPattern: string | undefined | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: nuxt/test-utils
Length of output: 4100
Preserve the exported helper’s argument contract.
getVitestConfigFromNuxtpreviously accepted aVitestConfigas its third argument. The new implementation readsuserConfig.test, so a caller that still passesVitestConfigas argument three can losebrowser.enabledand receiveoptimizeDeps.noDiscovery: true. Preserve the old call shape, or provide a compatibility overload that normalizes both forms before reading the browser setting.🤖 Prompt for AI Agents