Skip to content

Commit

Permalink
fix(vite): vitest executor should continue to load plugins #22001
Browse files Browse the repository at this point in the history
  • Loading branch information
Coly010 committed Jul 25, 2024
1 parent 37cc8ab commit abf084e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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

0 comments on commit abf084e

Please sign in to comment.