https://github.com/vektra/mockery
A mock code autogenerator for Go
https://github.com/vektra/mockery
generation generator go golang mock mockgen mocking mocks stretchr testify testing
Last synced: 5 days ago
JSON representation
A mock code autogenerator for Go
- Host: GitHub
- URL: https://github.com/vektra/mockery
- Owner: vektra
- License: bsd-3-clause
- Created: 2014-09-02T16:49:01.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-04-01T03:11:59.000Z (12 days ago)
- Last Synced: 2025-04-01T04:23:13.685Z (12 days ago)
- Topics: generation, generator, go, golang, mock, mockgen, mocking, mocks, stretchr, testify, testing
- Language: Go
- Homepage: https://vektra.github.io/mockery/
- Size: 38.5 MB
- Stars: 6,412
- Watchers: 33
- Forks: 427
- Open Issues: 51
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-go - mockery - Tool to generate Go interfaces. (Testing / Mock)
- my-awesome - vektra/mockery - 04 star:6.4k fork:0.4k A mock code autogenerator for Go (Go)
- awesome-list - mockery
- awesome-go - mockery - Tool to generate Go interfaces. Stars:`6.4K`. (Testing / Mock)
- awesome-golang-repositories - mockery
- awesome-go - Mockery
- awesome-go-extra - mockery - 09-02T16:49:01Z|2022-08-17T19:17:19Z| (Testing / Mock)
README
mockery
=======
[](https://github.com/vektra/mockery/actions/workflows/release.yml) [](https://pkg.go.dev/github.com/vektra/mockery/v2?tab=overview)   [](https://goreportcard.com/report/github.com/vektra/mockery) [](https://codecov.io/gh/vektra/mockery)mockery provides the ability to easily generate mocks for Golang interfaces using the [stretchr/testify/mock](https://pkg.go.dev/github.com/stretchr/testify/mock?tab=doc) package. It removes the boilerplate coding required to use mocks.
Documentation
--------------Documentation is found at our [GitHub Pages site](https://vektra.github.io/mockery/).
Development
------------taskfile.dev is used for build tasks. Initialize all go build tools:
```
go mod download -x
```You can run any of the steps listed in `Taskfile.yml`:
```
$ task test
task: [test] go test -v -coverprofile=coverage.txt ./...
```Stargazers
----------[](https://starchart.cc/vektra/mockery)