From 2d10f21e765c78f96f47cec6b6c03a42aae084ed Mon Sep 17 00:00:00 2001 From: Ivan Demchuk Date: Sun, 30 Jan 2022 10:25:35 +0200 Subject: [PATCH] fix: do not mutate options to get api config --- packages/vitest/src/node/plugins/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/vitest/src/node/plugins/index.ts b/packages/vitest/src/node/plugins/index.ts index 9b94688258cf..0b34cffc4ba5 100644 --- a/packages/vitest/src/node/plugins/index.ts +++ b/packages/vitest/src/node/plugins/index.ts @@ -22,8 +22,9 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest()) // preliminary merge of options to be able to create server options for vite // however to allow vitest plugins to modify vitest config values // this is repeated in configResolved where the config is final - const preOptions = deepMerge(options, viteConfig.test || {}) + const preOptions = deepMerge({}, options, viteConfig.test ?? {}) preOptions.api = resolveApiConfig(preOptions) + return { clearScreen: false, resolve: {