32.7 Type-Level Testing with tsd and expect-type
Right, so you’ve got your unit tests passing. Your functions are returning the right values. But are they returning the right types? Are you sure? In a language like TypeScript, a function can pass all its runtime tests with flying colors and still be a type-level catastrophe waiting to happen. This is where type-level testing comes in. It’s like putting a second, even more pedantic security guard at the door of your codebase—one who only cares about the IDs and not the person.