Stateless suite
piotrpalek opened this issue ยท 2 comments
piotrpalek commented
๐ I'm using Vest v4, is there any way to have a "stateless" suite? I want to pass an object and validate it from a fresh state each time, without having to worry about calling reset at the right time.
ealush commented
Hey, thanks for reaching out.
Just so you know, the V4 docs are still available on the site.
Here's the relevant page:
https://vestjs.dev/docs/4.x/understanding_state#server-side-validations
See the section: Server Side Validations
Basically, all you need to do is wrap the suite creation and execution with a function and you're done. Each call will create a new suite, ignoring past runs.
I hope that helps.
piotrpalek commented
somehow missed that in the docs, thanks for the quick response!