Skip to content

Releases: approvals/go-approval-tests

v1.10.0

15 Apr 20:24

Choose a tag to compare

This replaces the hotfix in v1.9.1 with a more robust filename sanitization approach aligned with how other approvals libraries handle filename generation

Breaking Changes

  • Approval file generation uses a new FileNameSanitizer to strip out problematic characters from approval file names which may change some filenames, it is configurable by setting approvals.CurrentFileNameSanitizer

to revert to the previous behaviour use the following:

approvals.CurrentFileNameSanitizer = func(filename string) string { return filename }

Full Changelog: v1.9.1...v1.10.0

v1.9.1 fix for module list error

20 Mar 18:40

Choose a tag to compare

Fixes an issue with file names in v1.9.0 that broke package verification with go list -u -m all and retracts v1.9.0

Full Changelog: v1.9.0...v1.9.1

v1.9.0 Reporter fixes, public interfaces and improved VerifyJSONBytes

25 Feb 18:53

Choose a tag to compare

Full Changelog: v1.8.0...v1.9.0

  • Changed FileOptions and Scrubber to be public (#73)
  • Fixed how we report files when running using -run parameters to avoid issues with the file cleanup utility (#74)
  • Added support for a Cursor reporter on OSX and fixed a precedence issue in OSX reporting that prevented valid reporters from being reached
  • Fixed VerifyJSONBytes to work with other valid JSON data, instead of only JSON objects (#39)

v1.8.0 Use codegen for reporters

11 Feb 18:33

Choose a tag to compare

Full Changelog: v1.7.0...v1.8.0

Moves to using the shared reporter configurations in https://github.com/approvals/DiffTools to generate reporters (using scripts/generate_diff_reporter.py) so we can have consistency in approvals across all supported languages. Add support for several new reporters in the process, see the csv file in DiffTools

v1.7.0 - VerifyOptions is public.

28 Jan 18:24

Choose a tag to compare

v1.6.2 - Fix directory name issue

12 Nov 17:48

Choose a tag to compare

Fixes issue with module verification noted in #65

v1.6.1 - AddDateScrubber and ConsoleOutput

28 Aug 18:05

Choose a tag to compare

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

16 Jul 17:23

Choose a tag to compare

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:

  1. Run all your tests and see them pass
  2. Upgrade go-approval-tests
  3. Run tests again (they will all fail)
  4. Run the approval python script
.approval_tests_temp/approve_all.py

Fix missing directory error

16 May 17:39

Choose a tag to compare

Options().ForFile().WithAdditionalInformation(value)

23 Apr 17:54

Choose a tag to compare

This allows multiple approved files per test.

More info here