From a3b4076f638224e456e8c5b6b11135b6d475dc64 Mon Sep 17 00:00:00 2001
From: tusooa <tusooa@kazv.moe>
Date: Fri, 28 Feb 2025 16:08:36 -0500
Subject: [PATCH] Fix test errors

---
 vite.config.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/vite.config.js b/vite.config.js
index 3a75817050..f1ee236614 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -121,6 +121,19 @@ export default defineConfig(async ({ mode, command }) => {
         cacheLocation: resolve(projectRoot, 'node_modules/.cache/stylelintcache')
       })
     ],
+    optimizeDeps: {
+      // For unknown reasons, during vitest, vite will re-optimize the following
+      // deps, causing the test to reload, so add them here so that it will not
+      // reload during tests
+      include: [
+        'custom-event-polyfill',
+        'vue-i18n',
+        '@ungap/event-target',
+        'lodash.merge',
+        'body-scroll-lock',
+        '@kazvmoe-infra/pinch-zoom-element'
+      ]
+    },
     css: {
       devSourcemap: true
     },
-- 
GitLab