Mocking for unit-tests and e2e-tests in golang

Some patterns to test your golang app.

Mocking an interface

https://github.com/vektra/mockery

Mocking SQL database

https://github.com/DATA-DOG/go-sqlmock

Mocking HTTP server for unit-tests

https://golang.org/pkg/net/http/httptest/

Stubbing HTTP server for e2e-tests

https://github.com/jmartin82/mmock

Mocking for e2e-tests with dockertest

https://github.com/ory/dockertest

Similar Posts

LEAVE A COMMENT