2025-09-23 14:18:04 +02:00
|
|
|
{
|
|
|
|
|
"compilerOptions": {
|
|
|
|
|
"target": "ES2022",
|
|
|
|
|
"module": "ES2022",
|
|
|
|
|
"moduleResolution": "node",
|
|
|
|
|
"resolveJsonModule": true,
|
|
|
|
|
"strict": true,
|
|
|
|
|
"esModuleInterop": true,
|
|
|
|
|
"skipLibCheck": true,
|
|
|
|
|
"forceConsistentCasingInFileNames": true,
|
|
|
|
|
"declaration": true,
|
|
|
|
|
"declarationMap": true,
|
|
|
|
|
"inlineSourceMap": true,
|
|
|
|
|
"allowJs": true,
|
|
|
|
|
"checkJs": false,
|
|
|
|
|
"noEmit": true,
|
2025-09-23 16:57:49 +02:00
|
|
|
"types": ["node"],
|
|
|
|
|
"baseUrl": "./",
|
|
|
|
|
"paths": {
|
|
|
|
|
"ponder/virtual": ["./node_modules/ponder/src/types.d.ts"]
|
|
|
|
|
}
|
2025-09-23 14:18:04 +02:00
|
|
|
},
|
fix: Ponder: add test infrastructure + coverage for helpers (target 95%) (#287)
- Add vitest ^2 + @vitest/coverage-v8 ^2 as devDependencies
- Add `test` and `test:coverage` scripts to package.json
- Create vitest.config.ts with resolve.alias to mock ponder virtual modules
(ponder:schema, ponder:registry) and point kraiken-lib/version to source
- Add coverage/ to .gitignore
- Add vitest.config.ts to tsconfig.json include so eslint project-aware rules apply
- Create src/tests/__mocks__/ponder-schema.ts and ponder-registry.ts stubs
- Create src/tests/stats.test.ts — 48 tests covering ring buffer logic,
segment updates, hourly advancement, projections, ETH reserve snapshots,
all exported async helpers with mock Ponder contexts
- Create src/tests/version.test.ts — 14 tests covering isCompatibleVersion,
getVersionMismatchError, and validateContractVersion (compatible / mismatch /
error paths, existing-meta upsert path)
- Create src/tests/abi.test.ts — 6 tests covering validateAbi and
validateContractAbi
Result: 68 tests pass, 100% line/statement/function coverage on all helpers
(stats.ts, version.ts, abi.ts, logger.ts) — exceeds 95% target.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-25 22:29:57 +00:00
|
|
|
"include": ["src/**/*", "ponder.config.ts", "ponder.schema.ts", "ponder-env.d.ts", "vitest.config.ts"],
|
2025-09-23 14:18:04 +02:00
|
|
|
"exclude": ["node_modules", ".ponder"]
|
2025-09-23 16:57:49 +02:00
|
|
|
}
|