WIP! A BB-style forum, on the ATmosphere!
We're still working... we'll be back soon when we have something to show off!
node
typescript
hono
htmx
atproto
1import { defineConfig } from "vitest/config";
2import { config as loadDotenv } from "dotenv";
3import { resolve } from "node:path";
4import { existsSync } from "node:fs";
5
6// Load .env file from monorepo root (for local dev)
7// Try main repo path first (../../.env from apps/appview)
8// If not found, try worktree path (../../../../.env from .worktrees/branch/apps/appview)
9const mainRepoPath = resolve(__dirname, "../../.env");
10const worktreePath = resolve(__dirname, "../../../../.env");
11const envPath = existsSync(mainRepoPath) ? mainRepoPath : worktreePath;
12
13// Load .env at config time so variables are available when tests run
14// dotenv won't override existing environment variables (e.g., from CI)
15loadDotenv({ path: envPath });
16
17export default defineConfig({
18 test: {
19 environment: "node",
20 // Run test files sequentially to avoid database conflicts
21 // Tests share a single test database and use the same test DIDs
22 fileParallelism: false,
23 },
24});