just looking through golang's testing category and making conclusions about what to use.
- go's
testing
package is good for starters. libs provide more expressive APIs.
- Andrew Gerrand's testing presentation is helpful
- use testify for assertions.
- your mileage may vary for supertest-style HTTP assertions.
- investigate ginkgo and testify suites.
- mocking is there if you need it.
- opinion: bmizerany/assert is simple, stretchr/testify/assert is feature rich.
- Testify
- A sacred extension to the standard go testing package.
- assert
- Basic Assertion Library used along side native go testing, with building blocks for custom assertions
- assert
- Asserts to Go testing
- opinion: unnecessary abstraction. also unmaintained.
- Hamcrest
- fluent framework for declarative Matcher objects that, when applied to input values, produce self-describing results.
- opinion: testify seems to have HTTP assertions.
- frisby
- a REST API testing framework
- restit
- A Go micro framework to help writing RESTful API integration test.
- Testify
- A sacred extension to the standard go testing package.
- opinion: cool. don't need it though.
- bro
- Watch files in directory and run tests for them
- opinion: quality varies. most seem to choose an assertion lib, syntax, and
reporter for you, so they lack extensibility. (though it's easy enough
to change syntax - just assign to a newly named
var
). - opinion: ginkgo seems well thought out.
- opinion: testify struct suites are also nice and object-oriented.
- ginkgo
- BDD Testing Framework for Go
- goblin
- Mocha like testing framework for Go
- gocheck
- A more advanced testing framework alternative to gotest.
- GoConvey
- BDD-style framework with web UI and live reload
- godog
- Cucumber or Behat like BDD framework for Go.
- GoSpec
- BDD-style testing framework for the Go programming language.
- gospecify
- This provides a BDD syntax for testing your Go code. It should be familiar to anybody who has used libraries such as rspec.
- Testify
- A sacred extension to the standard go testing package.
- zen and mao are lightweight options, though are obviously missing things
- opinion: DB mocks could be useful for speeding up DB tests. testify seems
to have
Called
methods. - Testify
- A sacred extension to the standard go testing package.
- counterfeiter
- Tool for generating self-contained mock objects
- go-sqlmock
- Mock SQL driver for testing database interactions
- go-txdb
- Single transaction based database driver mainly for testing purposes.
- gomock
- Mocking framework for the Go programming language.
- mockhttp
- Mock object for Go http.ResponseWriter
- opinion: interesting. don't need it though.
- go-mutesting
- Mutation testing for Go source code
- go-fuzz
- A randomized testing system
- gofuzz
- A library for populating go objects with random values
- gogenerate
- A Scalacheck-like library for Go
- Tavor
- A generic fuzzing and delta-debugging framework