I would like to be able to use the useTypeImports: true option while also mocking enums. I can use the enumsAsTypes: true option, but the enum isn't currently imported as a type, and the string literal isn't typed correctly as the appropriate enum.
I've added a new option castEnumsAsTypes to be used along with enumsAsTypes in order to cast the string values of enums to their correct type. Maybe this shouldn't be a separate option, or perhaps the option should have a different name. I considered having this functionality be the default if bothuseTypeImports and enumsAsTypes are true, but I went with a new option as I don't know how folks are using this library.
I would like to be able to use the
useTypeImports: true
option while also mocking enums. I can use theenumsAsTypes: true
option, but the enum isn't currently imported as a type, and the string literal isn't typed correctly as the appropriate enum.I've added a new option
castEnumsAsTypes
to be used along withenumsAsTypes
in order to cast the string values of enums to their correct type. Maybe this shouldn't be a separate option, or perhaps the option should have a different name. I considered having this functionality be the default if bothuseTypeImports
andenumsAsTypes
aretrue
, but I went with a new option as I don't know how folks are using this library.