Skip to content

Releases: approvals/go-approval-tests

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

v1.4.0 remove_abandoned_files.py script

09 Apr 17:13

Choose a tag to compare

v1.3.0 Failed comparison log and approve_all script.

03 Apr 17:27

Choose a tag to compare

  • Add Failed Comparison
  • Download approve_all script

Full Changelog: v1.2.1...v1.3.0

v1.2.1 Temp directory includes a .gitignore

27 Mar 17:32

Choose a tag to compare

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

12 Feb 18:31

Choose a tag to compare

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 ApprovalName namer, this should only affect people who are customizing the namer

Full Changelog: v1.1.1...v1.2.0

v1.1.1 Introducing core interfaces

06 Feb 18:44

Choose a tag to compare

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.ApprovalNamer interface
  • introduce core.ApprovalNamerCreator
  • introduce standalone core.Compare standalone
  • add options.ForFile().WithNamer

v1.1.0

30 Jan 19:08

Choose a tag to compare

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.