Releases: approvals/go-approval-tests
v1.6.1 - AddDateScrubber and ConsoleOutput
Added the ability to include your own custom date scrubbers and tools for testing console output as well as a convenience function for errors.
- DateScrubber.AddDateScrubber
- ConsoleOutput
- TestingUtils.utils.RequireNoError(t, err)
v1.6.0 Breaking Change - Ensure Approve Files end with a newline
v1.6.0 - This is a breaking change
Most, if not all, of your approved files will fail after upgrading to this version.
This is because approval files now expect to have a newline (\n) at the end of the file.
Upgrade Path
We suggest:
- Run all your tests and see them pass
- Upgrade
go-approval-tests - Run tests again (they will all fail)
- Run the approval python script
.approval_tests_temp/approve_all.pyFix missing directory error
Options().ForFile().WithAdditionalInformation(value)
This allows multiple approved files per test.
v1.4.0 remove_abandoned_files.py script
Full Changelog: v1.3.0...v1.4.0
v1.3.0 Failed comparison log and approve_all script.
- Add Failed Comparison
- Download approve_all script
Full Changelog: v1.2.1...v1.3.0
v1.2.1 Temp directory includes a .gitignore
Took away the need to change your .gitignore because of the temp directory
Full Changelog: v1.2.0...v1.2.1
v1.2.0 TemplatedCustomNamer
It is now easier to create a custom namer
func TestTemplatedCustomNamer(t *testing.T) {
custom := CreateTemplatedCustomNamerCreator("{TestSourceDirectory}/{ApprovalsSubdirectory}/{TestFileName}.{TestCaseName}.custom.{ApprovedOrReceived}.{FileExtension}")
VerifyString(t, "Hello", Options().ForFile().WithNamer(custom))
}
Breaking Changes
- We have removed the original
ApprovalNamenamer, this should only affect people who are customizing the namer
Full Changelog: v1.1.1...v1.2.0
v1.1.1 Introducing core interfaces
Breaking Changes
Note: we are not doing a major version bump as this creates a lot of weirdness in how you import packages in golang
Everything in here is a refactoring for extensibility but it moves classes that if you are customizing will cause breakage
- move logs to
internal/logs - introduce
core.ApprovalNamerinterface - introduce
core.ApprovalNamerCreator - introduce standalone
core.Comparestandalone - add
options.ForFile().WithNamer
v1.1.0
Log Approved Files
This release will now log all the approved files that were verified in the last run under ./.approval_tests_temp/.approved_files.log
Remember to add this to your .gitignore file.