37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import { defineConfig } from "vitest/config";
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globals: false,
|
|
environment: "node",
|
|
pool: "forks",
|
|
setupFiles: ["./tests/setup/polyfills.ts"],
|
|
include: ["src/**/*.test.ts"],
|
|
exclude: ["dist/**", "node_modules/**"],
|
|
coverage: {
|
|
provider: "istanbul",
|
|
reporter: ["text", "html", "lcov"],
|
|
include: ["src/**/*.ts"],
|
|
exclude: [
|
|
"src/**/*.test.ts",
|
|
"src/**/*.types.ts",
|
|
"src/**/index.ts",
|
|
// bin/hash-password.ts is a side-effect entry: an auto-exec
|
|
// guard (`if process.argv...; process.exit(main(...))`)
|
|
// wrapping a single delegation to main(). It can't be
|
|
// covered without spawning a subprocess. The main()
|
|
// function itself IS unit-tested via direct invocation in
|
|
// src/hash-password/hash-password.test.ts.
|
|
"src/bin/hash-password.ts",
|
|
],
|
|
thresholds: {
|
|
statements: 100,
|
|
branches: 100,
|
|
functions: 100,
|
|
lines: 100,
|
|
},
|
|
},
|
|
testTimeout: 30000,
|
|
},
|
|
});
|