You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
packer/vendor/github.com/approvals/go-approval-tests
Matthew Hooker d08f1b503f
Applies govenor migrate godep
10 years ago
..
reporters Propery vendor github.com/approvals/go-approval-tests 10 years ago
utils Propery vendor github.com/approvals/go-approval-tests 10 years ago
LICENSE.md Propery vendor github.com/approvals/go-approval-tests 10 years ago
README.md Propery vendor github.com/approvals/go-approval-tests 10 years ago
TODO.md Propery vendor github.com/approvals/go-approval-tests 10 years ago
approval_name.go Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals.go Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestReporterFromSetup.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyAllCombinationsFor1.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyAllCombinationsFor2.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyAllCombinationsFor9.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyAllCombinationsForSkipped.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyArray.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyArrayBadArray.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyArrayEmptyArray.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyArrayTransformation.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyBadJSONBytes.approved.json Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyBadXMLBytes.approved.xml Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyBadXMLStruct.approved.xml Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyJSONBytes.approved.json Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyJSONStruct.approved.json Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyMap.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyMapBadMap.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyMapEmptyMap.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyStringApproval.approved.txt Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyXMLBytes.approved.xml Propery vendor github.com/approvals/go-approval-tests 10 years ago
approvals_test.TestVerifyXMLStruct.approved.xml Propery vendor github.com/approvals/go-approval-tests 10 years ago
combination_approvals.go Propery vendor github.com/approvals/go-approval-tests 10 years ago

README.md

ApprovalTests.go

ApprovalTests for go

Build Status

Golden master Verification Library

ApprovalTests allows for easy testing of larger objects, strings and anything else that can be saved to a file (images, sounds, csv, etc...)

#Examples ##In Project Note: ApprovalTests uses approvaltests to test itself. Therefore there are many examples in the code itself.

##JSON VerifyJSONBytes - Simple Formatting for easy comparison. Also uses the .json file extension

func TestVerifyJSON(t *testing.T) {
	jsonb := []byte("{ \"foo\": \"bar\", \"age\": 42, \"bark\": \"woof\" }")
	VerifyJSONBytes(t, jsonb)
}

Matches file: approvals_test.TestVerifyJSON.received.json

{
  "age": 42,
  "bark": "woof",
  "foo": "bar"
}

##Reporters ApprovalTests becomes much more powerful with reporters. Reporters launch programs on failure to help you understand, fix and approve results.

You can make your own easily, here's an example You can also declare which one to use. Either at the

Method level

r := UseReporter(reporters.NewIntelliJ())
defer r.Close()

Test Level

func TestMain(m *testing.M) {
	r := UseReporter(reporters.NewBeyondCompareReporter())
	defer r.Close()

	m.Run()
}