-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encapsulate Snapshots as collection #40
Comments
I like this! And it makes updating config easier as the package evolves over time. Will think over tonight. Mind elaborating on the use case of multiple instances? |
As for multiple use cases, a nice example would be having one |
Makes sense. So long as there are sane (and equivalent) defaults, no reason to not provide additional functionality. Something like this perhaps? v1Snapshots := &Snapshots{
Dir: "testdata/v1",
}
v1Snapshots := &Snapshots{
Dir: "testdata/v2",
}
// ... in some test
v1Snapshots.AssertHTTPResponse(t, "example route v1", res1)
v2Snapshots.AssertHTTPResponse(t, "example route v2", res2) |
@b5 still interested in this? |
I am, but sadly have zero bandwidth to take on shipping this feature 😢. Considering this has been open for more than 6 months, might be worth closing? |
Building on the changes described in #39 into a more sustainable solution. I think it would make sense to isolate these configuration details into a struct that behaves in a similar way to
http.Client
, with aDefaultClient
variable that is automatically loaded to maintain current behaviour.Something like:
This is obviously a big change worth discussing first, but the upside would be the capacity to provision multiple instances of snapshot collections, allowing users to setup & teardown snapshots for versioned API tests in specific test funcs, etc.
The text was updated successfully, but these errors were encountered: