Tag Archives: mock

mountebank for mocking and stubbing http services (rest+graphql+grpc)

http://www.mbtest.org/docs/api/stubs can be used to stub http(s)/tcp/smtp protocols. And has community plugins for grpc, graphql, websockets. You can configure it with imposters.ejs like below:

docker-compose.yml

Mock sql (sqlx) db on golang

I am using this library — https://pkg.go.dev/github.com/data-dog/go-sqlmock. That’s how you can use it for mocking db querying:

mmock for mocking microservices

It is a very easy to set up though pretty powerful tool with support for delays and handling query params. It also has a console for checking all the requests and corresponding responses matched. Here it is https://github.com/jmartin82/mmock. Below I describe a way to use it with docker-compose for local development.

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

Эмуляция запросов к серверу в angular.js

Очень удобно, если сначала разрабатывается полностью клиентская часть.