DEV Community

Discussion on: ts-faker - Generating fake data using TypeScript interfaces

Collapse
 
raulinlee profile image
Lee Raulin

Pretty cool proof of concept, but for it to be useful for me, it would need to be able to handle interfaces composed of other interfaces. Even if I provide all the interfaces in a valid TS file, it just treats each one separately, creating data for them all, which I don't need, and treating interface types as strings, which means I'd to manually paste in data for nested interfaces, which sort of defeats the point.

Collapse
 
ingokodba profile image
Ingo Kodba

Yes, that is exacly what is missing. It needs to work on interfaces with all kinds of types, and fake data that generates should be of type that variable name implicates. Currently intermock module is the closest to that kind of thing, but it doesn't work between multiple files. Otherwise, nice work.