approvals / go-approval-tests

Apache License 2.0
86 stars 22 forks source link

Feature request - allow overriding of filename #33

Open patmacpherson-sc opened 2 years ago

patmacpherson-sc commented 2 years ago

Currently, the files are named after the executed test.

However, if you want to run multiple approvals in a single test (for example, with a table driven test) then the different approvals will overwrite each other.

It would be nice to have a function like-

func VerifyWithFilename(t Failable, reader io.Reader, filename string) 

which overrides the default naming behaviour.

hjwk commented 2 years ago

I think this can be easily added, I will work on a PR for it soon