Files
ansiblings/packages/nopy/vitest.config.ts
T

43 lines
1.3 KiB
TypeScript
Raw Normal View History

2026-07-28 12:18:10 +02:00
import { fileURLToPath } from 'node:url';
2026-07-27 13:09:00 +02:00
import { defineConfig } from 'vitest/config';
export default defineConfig({
2026-07-28 12:18:10 +02:00
resolve: {
alias: {
2026-07-29 13:07:34 +02:00
// The workspace link points at nopy-cubes's `dist`, which only exists after
2026-07-28 12:18:10 +02:00
// a build. Tests read its source instead, so the gate does not depend on
// build ordering and never runs against a stale artifact.
2026-07-29 13:07:34 +02:00
'@bitsquare/nopy-cubes': fileURLToPath(
new URL('../nopy-cubes/src/index.ts', import.meta.url)
),
2026-07-28 12:18:10 +02:00
},
},
2026-07-27 13:09:00 +02:00
test: {
globals: true,
environment: 'node',
pool: 'forks', // Use forks instead of threads to support process.chdir()
include: ['src/**/*.test.ts', 'tests/**/*.test.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'json-summary', 'html'],
2026-07-27 13:09:00 +02:00
include: ['src/**/*.ts'],
exclude: [
'src/**/*.test.ts',
2026-07-28 12:18:10 +02:00
// Reached through the resolve.alias above; it has its own gate.
2026-07-29 13:07:34 +02:00
'**/nopy-cubes/**',
// Pure re-export barrels: no logic to cover.
'src/index.ts',
'src/cubes/index.ts',
'src/nopy.cubes.ts',
// Commander wiring only; behaviour lives in the modules it calls.
'src/nopy.cli.ts',
],
thresholds: {
branches: 85,
functions: 85,
lines: 80,
statements: 80,
},
2026-07-27 13:09:00 +02:00
},
},
});