Show HN: Smartass – TypeScript test assertions with type-narrowing signatures

I thought it was a shame that the expect() fluent interface in Jest and Vitest is unable to make use of a TypeScript feature called assertion signatures. Assertion signatures seem like a natural fit for test assertions, because they let you align real run-time validation with compile-time type information. I wanted to be able to do both of those things in one go in tests, so I put together this small library of test assertion functions and composable matcher functions with assertion signatures.
3 points xiuyuan 4 months ago 0 comments

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton