Back to browse
GitHub Repository

TypeScript-first test assertion functions with precise type narrowing via assertion signatures.

1 starsTypeScript

Smartass – TypeScript test assertions with type-narrowing signatures

by xiuyuan·Jun 14, 2026·3 points·0 comments

AI Analysis

●●SolidSolve My ProblemNiche Gem

Type-narrowing assertions that Jest and Vitest's expect() can't provide.

Strengths
  • Assertion signatures align runtime validation with compile-time type information
  • Composable matchers like arrayIncluding and oneOf for nested object validation
  • Standalone functions work without Jest/Vitest test runner dependencies
Weaknesses
  • Small library with 64 commits and zero forks suggests limited adoption or maturity
  • Doesn't integrate with existing expect() chains, requires rewriting test assertions
Target Audience

TypeScript developers writing unit tests

Similar To

Jest · Vitest · Expect

Post Description

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.

Similar Projects

Attest – Test AI agents with 8-layer graduated assertions

I built Attest because every team I've seen building AI agents ends up writing the same ad-hoc pytest scaffolding — checking if the right tools were called, if

tommathews
103mo ago