proofchain/packages/api/vitest.config.ts
caelum0x e361a8dc22 feat: ProofChain platform — 64 contracts (11 modules), backend API, expanded web
- core: AddressBook registry, Roles lib, ProofChainAccess base, Pauser
- modules: provenance, payments/treasury, identity, reputation, finance/RWA,
  insurance, disputes+governance, esg/tokenization, marketplace, rewards
- @proofchain/api: 33 routers + event indexer (Supabase)
- web: 37 pages incl landing, explorer, finance, governance, esg, marketplace
- 704 forge tests + 449 vitest tests green; 61 ABIs exported

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-31 19:22:38 +03:00

37 lines
1.0 KiB
TypeScript

import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
/**
* The API depends on the workspace packages `@proofchain/shared` and
* `@proofchain/infra`, both built during the integration phase. To keep this
* package independently testable — with NO network, NO RPC and NO Supabase —
* tests resolve those imports to in-package deterministic test doubles. See
* `test/doubles/*.ts` and README.md ("Testability").
*/
const sharedDouble = fileURLToPath(
new URL('./test/doubles/shared.ts', import.meta.url),
);
const infraDouble = fileURLToPath(
new URL('./test/doubles/infra.ts', import.meta.url),
);
export default defineConfig({
resolve: {
alias: {
'@proofchain/shared': sharedDouble,
'@proofchain/infra': infraDouble,
},
},
test: {
globals: true,
environment: 'node',
include: ['test/**/*.test.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'lcov'],
include: ['src/**/*.ts'],
exclude: ['src/index.ts', 'src/**/*.d.ts'],
},
},
});