Skip to content
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(vite): vitest executor should continue to load plugins #22001 #27118

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/vite/src/executors/test/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ export async function getOptions(
configFile: viteConfigPath,
};

return mergeConfig(resolved?.config?.['test'] ?? {}, settings);
return {
resolvedOptions: mergeConfig(resolved?.config?.['test'] ?? {}, settings),
plugins: resolved?.config?.plugins,
};
}

export function getOptionsAsArgv(obj: Record<string, any>): string[] {
Expand Down
5 changes: 3 additions & 2 deletions packages/vite/src/executors/test/vitest.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function* vitestExecutor(
// Allows ESM to be required in CJS modules. Vite will be published as ESM in the future.
const { startVitest } = await loadVitestDynamicImport();

const resolvedOptions =
const { resolvedOptions, plugins } =
(await getOptions(options, context, projectRoot)) ?? {};

const watch = resolvedOptions['watch'] === true;
Expand All @@ -37,7 +37,8 @@ export async function* vitestExecutor(
const ctx = await startVitest(
resolvedOptions['mode'] ?? 'test',
cliFilters,
resolvedOptions
resolvedOptions,
{ plugins }
);

let hasErrors = false;
Expand Down