From 6324a00e640e939028d2e8084d9cfd8b5ebce14d Mon Sep 17 00:00:00 2001 From: Vladimir Date: Thu, 14 Nov 2024 10:38:04 +0100 Subject: [PATCH] refactor: don't provide extends/workspaceConfigPath in the config (#6904) --- packages/vitest/src/node/workspace.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/vitest/src/node/workspace.ts b/packages/vitest/src/node/workspace.ts index fea8e499818f..0fce02385324 100644 --- a/packages/vitest/src/node/workspace.ts +++ b/packages/vitest/src/node/workspace.ts @@ -54,6 +54,7 @@ export async function initializeProject( ) { const project = new WorkspaceProject(workspacePath, ctx, options) + const { extends: extendsConfig, workspaceConfigPath, ...restOptions } = options const root = options.root || (typeof workspacePath === 'number' @@ -62,14 +63,14 @@ export async function initializeProject( ? workspacePath : dirname(workspacePath)) - const configFile = options.extends - ? resolve(dirname(options.workspaceConfigPath), options.extends) + const configFile = extendsConfig + ? resolve(dirname(workspaceConfigPath), extendsConfig) : typeof workspacePath === 'number' || workspacePath.endsWith('/') ? false : workspacePath const config: ViteInlineConfig = { - ...options, + ...restOptions, root, configFile, // this will make "mode": "test" | "benchmark" inside defineConfig