4cddfcf2f3
Backend Tests / Tests (other) (push) Failing after 1s
Backend Tests / Static Checks (push) Failing after 2s
Backend Tests / Tests (internal) (push) Failing after 2s
Backend Tests / Tests (server) (push) Failing after 1s
Backend Tests / Tests (store) (push) Failing after 1s
Build Canary Image / build-frontend (push) Failing after 1s
Frontend Tests / Lint (push) Failing after 1s
Build Canary Image / build-push (linux/amd64) (push) Has been skipped
Build Canary Image / build-push (linux/arm64) (push) Has been skipped
Build Canary Image / merge (push) Has been skipped
Frontend Tests / Build (push) Failing after 1s
Release Please / release-please (push) Failing after 0s
Proto Linter / Lint Protos (push) Failing after 2s
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import react from "@vitejs/plugin-react";
|
|
import { resolve } from "path";
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
// Vitest configuration. Kept separate from `vite.config.mts` so the dev/build
|
|
// pipelines stay lean and so tests can opt into jsdom + @testing-library
|
|
// without dragging them into production bundles.
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
// Keep in sync with the `@/` alias declared in `vite.config.mts` so that
|
|
// test-time module resolution matches production/build.
|
|
alias: {
|
|
"@/": `${resolve(__dirname, "src")}/`,
|
|
},
|
|
},
|
|
test: {
|
|
environment: "jsdom",
|
|
setupFiles: ["./tests/setup.ts"],
|
|
include: ["tests/**/*.test.{ts,tsx}"],
|
|
// Keep each test hermetic:
|
|
// - mockReset clears call history and resets implementations for vi.fn()s,
|
|
// so module-level mocks (e.g. useCurrentUser) don't leak between tests.
|
|
// - restoreMocks additionally restores original implementations for spies.
|
|
mockReset: true,
|
|
restoreMocks: true,
|
|
},
|
|
});
|