Files
native-monad/.claude/rules/testing.md

564 B

paths
paths
**/*.spec.ts
**/*.type-spec.ts

Test Conventions

  • *.spec.ts — runtime tests. Use Arrange/Act/Assert with describe/it blocks.
  • *.type-spec.ts — compile-time type tests. Use expectTypeOf(x).toEqualTypeOf<T>() from expect-type.
  • Tests live in spec/ directories next to the module, one file per operation (e.g., map.spec.ts).
  • When adding a new method, create both a *.spec.ts and *.type-spec.ts for it.
  • Run runtime tests: pnpm test -- src/{module}/spec/{file}.spec.ts
  • Run type tests: pnpm test:types