unit test auto-provider refactor
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 19m58s

This commit is contained in:
2026-01-02 11:33:05 -08:00
parent e3c876c7be
commit 9fd15f3a50
22 changed files with 306 additions and 231 deletions

View File

@@ -41,12 +41,14 @@ export default defineConfig({
// By default, Vitest does not suppress console logs.
// The onConsoleLog hook is only needed if you want to conditionally filter specific logs.
// Keeping the default behavior is often safer to avoid missing important warnings.
environment: 'jsdom',
// Explicitly point Vitest to the correct tsconfig and enable globals.
globals: true, // tsconfig is auto-detected, so the explicit property is not needed and causes an error.
globalSetup: './src/tests/setup/global-setup.ts',
setupFiles: ['./src/tests/setup/tests-setup-unit.ts'],
// The globalApiMock MUST come first to ensure it's applied before other mocks that might depend on it.
setupFiles: [
'./src/tests/setup/globalApiMock.ts',
'./src/tests/setup/tests-setup-unit.ts',
],
// Explicitly include only test files.
// We remove 'src/vite-env.d.ts' which was causing it to be run as a test.
include: ['src/**/*.test.{ts,tsx}'],