mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-02 21:49:42 +02:00
#356 and #371 fixed the same leak two ways. #356 pointed CODEMAN_DATA_DIR at a second throwaway directory and cleaned it up in afterAll and on exit; #371 deletes the variable along with CODEMAN_INSTANCE and CODEMAN_TMUX_SOCKET, so `getDataDir()` falls back to `homedir()`, which the temp HOME already redirects. Merged as they were, setup.ts set the variable and deleted it a few lines later, and the second directory was created for nothing. The strip wins: same protection, one tree to clean up, and the isolation test #371 adds pins the list statically. The extra directory, its restore and its two rmSync calls go, the vitest config `env` entries that set the same variable go (they were documented as inert and would now be contradicted by the setup file either way), the two test comments that described the old mechanism are reworded, and CLAUDE.md's testing paragraph names the three stripped variables and why CODEMAN_INSTANCE has to be stripped in the setup file rather than a hook. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qg6bcATm1pNNY4kQWGwzgu
38 lines
1.4 KiB
TypeScript
38 lines
1.4 KiB
TypeScript
import { resolve } from 'node:path';
|
|
import { defineConfig } from 'vitest/config';
|
|
|
|
const root = resolve(import.meta.dirname, '..');
|
|
|
|
/**
|
|
* EVERY test in the repo, including the ones that cannot pass on an arbitrary
|
|
* machine — `npm run test:all`. Reach for it when you want the complete picture
|
|
* and are prepared to read past environmental failures.
|
|
*
|
|
* This is NOT what `npm test` runs. On a machine without chromium, a free port
|
|
* or per-machine PNG baselines this config fails ~87 tests on a clean master,
|
|
* which makes it useless as a pass/fail signal: the default gate is
|
|
* config/vitest.ci.config.ts, and the suites it leaves out each have their own
|
|
* runner (`test:browser`, `test:perf`, `test:mobile`). See config/test-suites.ts.
|
|
*/
|
|
export default defineConfig({
|
|
test: {
|
|
root,
|
|
globals: true,
|
|
environment: 'node',
|
|
include: ['test/**/*.test.ts'],
|
|
setupFiles: ['./test/setup.ts'],
|
|
// Run test files sequentially to respect mux session limits
|
|
// Individual tests within files still run in parallel where safe
|
|
fileParallelism: false,
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html'],
|
|
include: ['src/**/*.ts'],
|
|
exclude: ['src/index.ts', 'src/cli.ts'],
|
|
},
|
|
testTimeout: 30000, // 30 seconds for integration tests
|
|
// Ensure cleanup runs even on test failures
|
|
teardownTimeout: 60000,
|
|
},
|
|
});
|