You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go has a convention to put test data files under projectroot/testdata, I think it makes sense to store approved (and temporary/received files possibly too) there by default. Possibly making this configurable, but that is less important imho.
See https://ieftimov.com/post/testing-in-go-golden-files/ for more info. Side note: Maybe that blogger is interested in helping out on this lib too, (s)he seems to know quite a bit on approval tests, even if the terminology is somewhat dated (golden files in the blog post).
The text was updated successfully, but these errors were encountered:
As a detail, testdata does not have to be in the root of the project, it is generally ignored. So it is possible to have package-specific testdata subfolder holding related samples.
As per go help test:
The go tool will ignore a directory named "testdata", making it available to hold ancillary data needed by the tests.
Go has a convention to put test data files under projectroot/testdata, I think it makes sense to store approved (and temporary/received files possibly too) there by default. Possibly making this configurable, but that is less important imho.
See https://ieftimov.com/post/testing-in-go-golden-files/ for more info. Side note: Maybe that blogger is interested in helping out on this lib too, (s)he seems to know quite a bit on approval tests, even if the terminology is somewhat dated (golden files in the blog post).
The text was updated successfully, but these errors were encountered: