effective-typescript icon indicating copy to clipboard operation
effective-typescript copied to clipboard

A new way to test types

Open utterances-bot opened this issue 3 years ago • 2 comments

A new way to test types

Effective TypeScript: A new way to test types

https://effectivetypescript.com/2022/05/28/eslint-plugin-expect-type/

utterances-bot avatar Jun 07 '22 19:06 utterances-bot

Why not simply add a type annotation?

louwers avatar Jun 07 '22 19:06 louwers

@louwers Adding a type annotation will test assignability, not type equality or the display of the type (which is also part of the usability of the library, see The Display of Types). Assignability is particularly problematic when any types enter the mix.

danvk avatar Aug 25 '22 12:08 danvk