DEV Community

Discussion on: Typescript for beginners: how to ignore code

Collapse
 
chadams profile image
Chad Adams

This is mostly used in situations where you are writing units tests. Say you want to test a function that takes a large complex object, but only operates on a smaller set of its data. you can pass in a smaller object missing the un-required keys, but that will throw a type error. This is a simple way around that.