- vitest.config.ts: add statements/functions/branches thresholds alongside
lines so the coverage gate catches regressions in all four dimensions
- tests/stats.test.ts: replace weak "> 0n" / "toBeDefined()" assertions with
exact expected values derived from the ring buffer algebra:
- hour-advanced path: mintedLastWeek=480n, mintedLastDay=220n,
burnedLastWeek=240n, burnedLastDay=110n, mintNextHourProjected=68n,
burnNextHourProjected=34n, netSupplyChangeDay=110n,
netSupplyChangeWeek=240n
- same-hour projection path: mintNextHourProjected=140n (elapsed-seconds
scaling verified), burnNextHourProjected=0n (medium=0 fallback path)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
30 lines
792 B
TypeScript
30 lines
792 B
TypeScript
import { defineConfig } from 'vitest/config';
|
|
import { fileURLToPath } from 'url';
|
|
import { dirname, resolve } from 'path';
|
|
|
|
const rootDir = dirname(fileURLToPath(import.meta.url));
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
globals: false,
|
|
environment: 'node',
|
|
coverage: {
|
|
provider: 'v8',
|
|
include: ['src/helpers/**/*.ts'],
|
|
reporter: ['text', 'lcov'],
|
|
thresholds: {
|
|
lines: 95,
|
|
statements: 95,
|
|
functions: 95,
|
|
branches: 80,
|
|
},
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'ponder:schema': resolve(rootDir, 'tests/__mocks__/ponder-schema.ts'),
|
|
'ponder:registry': resolve(rootDir, 'tests/__mocks__/ponder-registry.ts'),
|
|
'kraiken-lib/version': resolve(rootDir, '../../kraiken-lib/src/version.ts'),
|
|
},
|
|
},
|
|
});
|