diff alternatives and similar packages
Based on the "Testing Frameworks" category.
Alternatively, view diff alternatives based on common mentions on social networks and blogs.
-
Testify
A toolkit with common assertions and mocks that plays nicely with the standard library -
GoConvey
Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go. -
dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work. -
gnomock
Test your code without writing mocks with ephemeral Docker containers ๐ฆ Setup popular services with just a couple lines of code โฑ๏ธ No bash, no yaml, only code ๐ป -
go-vcr
Record and replay your HTTP interactions for fast, deterministic and accurate tests -
testfixtures
Ruby on Rails like test fixtures for Go. Write tests against a real database -
embedded-postgres
Run a real Postgres database locally on Linux, OSX or Windows as part of another Go application or test -
gotest.tools
A collection of packages to augment the go testing package and support common patterns. -
testza
Full-featured test framework for Go! Assertions, fuzzing, input testing, output capturing, and much more! ๐ -
go-testdeep
Extremely flexible golang deep comparison, extends the go testing package, tests HTTP APIs and provides tests suite -
dbcleaner
Clean database for testing, inspired by database_cleaner for Ruby -
GoSpec
Testing framework for Go. Allows writing self-documenting tests/specifications, and executes them concurrently and safely isolated. [UNMAINTAINED] -
jsonassert
A Go test assertion library for verifying that two representations of JSON are semantically equal -
testcase
testcase is an opinionated testing framework to support test driven design. -
assert
:exclamation:Basic Assertion Library used along side native go testing, with building blocks for custom assertions
InfluxDB - Power Real-Time Data Analytics at Scale
Do you think we are missing an alternative of diff or a related project?
Popular Comparisons
README
diff
diff
contains git-style diff generation helpers, particularly useful for tests.
Install
go get oss.terrastruct.com/diff
Usage
diff.Strings
Tired of ugly "expected" vs "actual" test outputs? diff.Strings
gives you git-style
diffs:
exp := ...
actual := YourFunction()
diffs, err := diff.Strings(exp, actual)
if ds != "" {
t.Fatalf("unexpected result: %s", ds)
}
diff.Testdata
Sometimes the expected is not a simple string to include in your test. Sometimes it's a
long JSON blob that you want to compare. Use diff.Testdata
to easily store and compare
test results to saved files.
err := diff.Testdata("test_results", actual)
if err != nil {
t.Fatal(err)
}
An example of this is the first image in this README. You can then choose to accept the
new actual
by rerunning the test with TESTDATA_ACCEPT=1
environment variable.
Assert
You can also use diff.AssertJSONEq
and diff.AssertStringEq
in testing environments to
shorthand the above "if fail then Fatal" code.