Files
lam-agent-vicinae/vitest.config.mts
T

33 lines
1.2 KiB
TypeScript

import { fileURLToPath } from "node:url";
import { defineConfig } from "vitest/config";
/**
* `.mts` rather than `.ts`: this package is CommonJS (the Vicinae toolchain
* compiles extensions with `module: commonjs`), and Vite warns when an ESM
* config is loaded as CJS. The extension lets us write the config as ESM.
*/
export default defineConfig({
test: {
globals: true,
include: ["src/__tests__/**/*.test.ts"],
/**
* One file at a time.
*
* The retention and snip tests exercise the real file system, and the snip
* directory is a single fixed path taken from the stubbed `environment`
* (`/tmp/lam-agent-support/snips`). Two files running at once would each
* clear and repopulate the other's directory mid-test, so files are run
* sequentially rather than giving every file its own path to reason about.
* The whole suite is well under a second either way.
*/
fileParallelism: false,
},
resolve: {
alias: {
// Point the API package at the in-memory stub; there is no Vicinae
// runtime under test.
"@vicinae/api": fileURLToPath(new URL("./src/__mocks__/@vicinae/api.ts", import.meta.url)),
},
},
});