Show HN: Smartass – TypeScript test assertions with type-narrowing signatures
Posted 3 hours ago by xiuyuan
3 points
https://github.com/KensioSoftware/smartass/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.