Show HN: Smartass – TypeScript test assertions with type-narrowing signatures (github.com)

3 points by xiuyuan ↗ HN
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.

0 comments

[ 3.0 ms ] story [ 9.8 ms ] thread

No comments yet.