Server/project/vitest.config.ts
TheSparta 1f0318e66d Create container once before all tests
- Doesn't recreate the container for each test file, only loads the database once at the start, makes it much faster.
- Every test file should be imported in `Setup.test.ts` in order for it to work.
2023-11-05 16:59:54 +00:00

33 lines
921 B
TypeScript

/* eslint-disable @typescript-eslint/naming-convention */
import path from "node:path";
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
name: "spt-server",
api: 51204,
reporters: ["default"],
root: "./",
include: ["tests/Setup.test.ts"],
cache: false,
environment: "./tests/CustomEnvironment.ts",
globals: true,
coverage: {
provider: "istanbul",
reporter: ["text", "html"],
reportsDirectory: "./tests/__coverage__",
reportOnFailure: true,
all: true,
include: ["src"],
exclude: ["src/models/**", "tests/**"]
},
typecheck: {
enabled: true
},
alias: {
"@spt-aki": path.resolve(__dirname, "src"),
"@tests": path.resolve(__dirname, "tests")
}
}
});