-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Expand file tree
/
Copy pathvitest.config.ts
More file actions
21 lines (19 loc) · 776 Bytes
/
Copy pathvitest.config.ts
File metadata and controls
21 lines (19 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { defineConfig } from "vitest/config";
import { join } from "node:path";
import { tmpdir } from "node:os";
import { mkdtempSync } from "node:fs";
// Tests must never see the developer's real $HOME: config.ts reads
// ~/.agentmemory/.env underneath process.env, so asserted defaults would
// silently become whatever the local install happens to set — red on clean
// checkouts, green on machines whose .env masks a broken default. Point HOME
// at a throwaway directory for the whole run; tests that need home-dir state
// create their own sandbox and reset HOME themselves.
const testHome = mkdtempSync(join(tmpdir(), "agentmemory-test-home-"));
export default defineConfig({
test: {
env: {
HOME: testHome,
USERPROFILE: testHome,
},
},
});