Previously, 15 e2e tests were skipped because TEST_USER_EMAIL and TEST_USER_PASSWORD env vars weren't set. Now the test harness: - Starts a fresh PocketBase instance in /tmp on port 8091 - Creates admin user, collections, and API rules automatically - Seeds test user with period data for authenticated tests - Cleans up temp directory after tests complete Also fixes: - Override toggle tests now use checkbox role (not button) - Adds proper wait for OVERRIDES section before testing toggles - Suppresses document.cookie lint warning with explanation Test results: 64 e2e tests pass, 1014 unit tests pass Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
24 lines
587 B
TypeScript
24 lines
587 B
TypeScript
// ABOUTME: Vitest configuration for unit and integration testing.
|
|
// ABOUTME: Configures jsdom environment for React component testing.
|
|
import path from "node:path";
|
|
import react from "@vitejs/plugin-react";
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
test: {
|
|
environment: "jsdom",
|
|
include: [
|
|
"src/**/*.test.{ts,tsx}",
|
|
"scripts/**/*.test.ts",
|
|
"e2e/**/*.test.ts",
|
|
],
|
|
setupFiles: ["./src/test-setup.ts"],
|
|
},
|
|
});
|