Development
Scripts, test layout, and contribution guidelines for vern-llm
pnpm install
pnpm run build # tsdown → dist (ESM + CJS + types)
pnpm run typecheck # tsc --noEmit on src, since tsdown doesn't fully type-check
pnpm run typecheck:test # tsc --noEmit on src + test (separate tsconfig, no rootDir conflict)
pnpm run test # vitest run (unit + integration)
pnpm run test:unit # vitest run --project unit
pnpm run test:int # vitest run --project integration
pnpm run test:watch # vitest, watch mode
pnpm run test:coverage # vitest run --coverage (v8 provider)
pnpm run lint # oxlint
pnpm run format # oxfmt
pnpm run changeset # record a change for the next releaseTest layout
Tests live under tests/unit/ and tests/integration/. No real API calls are made anywhere in the suite; everything runs against fakes and mocks.
tests/unit/
| File | Covers |
|---|---|
vernLLM.call, vernLLM.schema | Retry, backoff, timeout, abort, schema, model override, usage |
circuitBreaker | Breaker as a standalone unit |
cachedCall | Caching, usage reservation/refund |
logger | Injectable logger |
vernLLM.history | Multi-turn history validation |
vernLLM.utils | Internal helpers |
index.exports | Public export surface |
adapters/* | Each provider's request/response translation against a fake client |
tests/integration/
| File | Covers |
|---|---|
vernLLM, vernLLM.history, cachedCall | Workflow-level behavior |
adapters/* | Workflow-level behavior per provider |
Contributing
See Contributing for the full guide: forking, branch setup, test expectations, and the pre-PR checklist.