From 03421279eda9a87e40db608611d09e78a9fcae9b Mon Sep 17 00:00:00 2001 From: lakb248 Date: Fri, 12 May 2023 23:12:43 +0800 Subject: [PATCH] fix(vitest): add transformMode config for jsx component test (#269) --- template/config/vitest/vitest.config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/template/config/vitest/vitest.config.js b/template/config/vitest/vitest.config.js index a2f57a5d..3d919213 100644 --- a/template/config/vitest/vitest.config.js +++ b/template/config/vitest/vitest.config.js @@ -9,7 +9,10 @@ export default mergeConfig( test: { environment: 'jsdom', exclude: [...configDefaults.exclude, 'e2e/*'], - root: fileURLToPath(new URL('./', import.meta.url)) + root: fileURLToPath(new URL('./', import.meta.url)), + transformMode: { + web: [/\.[jt]sx$/], + }, } }) ) -- 2.39.5