Test your types with tsc
Compile-time type tests and more than 200 utility types for TypeScript. No test runner and no runtime cost.
AssertTrue and AssertFalse
Boolean assertions at compile time, with custom messages. A failing test shows up as a red underline in your editor.
Expect<Equal>
Structural equality for types. It catches widening, distributive drift, and excess-property regressions.
200+ utility types
Primitives, predicates, strings, tuples, objects, numbers, unions, and brands, each imported from its own subpath.
Zero runtime
The
.jsfiles are empty on purpose. Every utility disappears at build time, so your bundle stays the same.Subpath imports
Import
@gentleduck/ttest/stringor/tuple. Each domain has its own entry, so you only load what you use.No test runner
No Jest and no Vitest.
tsc --noEmitruns your tests in any project, editor, or CI.
Install
Install it as a dev dependency, write tests in .test-d.ts files, and let tsc run them.
Install
bun add -D @gentleduck/ttestWrite a type test
import type { AssertTrue, Equal } from '@gentleduck/ttest/assert' type _test = AssertTrue<Equal<Uppercase<'gentle'>, 'GENTLE'>, 'uppercase works'>
Free & open source
gentleduck is MIT licensed and will always be free and open source. Every package ships with full source access — fork it, modify it, own it.