synpress
synpress copied to clipboard
[💡 Feature]: Validate all user inputs with zod
Is your feature request related to a problem?
Easy low hanging fruit is to validate all userInput with zod. E.g.
z.object({
secretWordsOrPrivateKey: z.string().refine(isPrivateKeyOrSecretWords),
...,
}).parse(setupMetamaskOptions)
This would fix an issue where passing in bad user input often throws a non obvious error message. e.g. not including secretWordsOrPrivateKey throws cannot read property includes of undefined
Describe the solution you'd like.
Validate user input before running synpress
Describe alternatives you've considered.
Typescript partially fixes this problem but zod gives the runtime safety too
Additional context
No response