Change assertion calls to use testing.TB interface#53
Merged
sebdah merged 2 commits intosebdah:masterfrom Oct 11, 2025
Merged
Conversation
1a58b55 to
d220736
Compare
…File data to allow easy reading of golden files
d220736 to
188fad9
Compare
ccoVeille
reviewed
Sep 29, 2025
| // options to an OptionProcessor. | ||
| type Option func(OptionProcessor) error | ||
|
|
||
| type TB testing.TB |
There was a problem hiding this comment.
why adding this interface while you could have used testing.TB directly in the Tester interface ?
There is nothing wrong with this, but I don't see the point here.
Author
There was a problem hiding this comment.
It was to have an interface that could be extended later but i see there is another interface already in the project for that purpose, I have changed to the testing.TB interface.
ccoVeille
reviewed
Sep 29, 2025
ccoVeille
approved these changes
Oct 2, 2025
Author
|
Thanks for approval @ccoVeille. @sebdah are you able to have a look? |
Owner
|
Looks great, thanks for this! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is to make extending goldie easier in the consumer. This was to change the assertions to using the TB interface which makes overriding functions within the testing framework possible to override.
An example of issues this solves is that if you want to override the FailNow call's to intercept this failure before failing the test, using the interface makes this possible rather than using the concrete testing.T type.
This also exposes the get golden file to a public function to assist in retrieving golden test files.