Attest
Attest is a testing library that makes your TypeScript types available at runtime, giving you access to precise type-level assertions and performance benchmarks.
Assertions are framework agnostic and can be seamlessly integrated with your existing Vitest, Jest, or Mocha tests.
Benchmarks can run from anywhere and will deterministically report the number of type instantiations contributed by the contents of the bench call.
If you've ever wondered how ArkType can guarantee identical behavior between its runtime and static parser implementations and highly optimized editor performance, Attest is your answer⚡
Installation
npm install @ark/attest
Note: This package is still in alpha! Your feedback will help us iterate toward a stable 1.0.
Docs
See arktype.io/docs/attest for:
- Setup with Vitest, Mocha and other test runners
- Assertions for types, values, errors, completions and JSDoc
- Benches measuring type instantiations and runtime
- Options like
skipTypesandtypeToStringFormat - The CLI for type performance stats and traces
- Integrating attest's type data into your own assertions
Please don't hesitate to open a GitHub issue or discussion or reach out on ArkType's Discord if you have any questions or feedback- we'd love to hear from you! ⛵