GithubHelp home page GithubHelp logo

ifross89 / mockery Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vektra/mockery

0.0 0.0 0.0 27.77 MB

A mock code autogenerator for Go

Home Page: https://vektra.github.io/mockery/

License: BSD 3-Clause "New" or "Revised" License

Shell 0.70% Go 99.05% HTML 0.09% Dockerfile 0.15%

mockery's Introduction

mockery

Release go.dev reference GitHub go.mod Go version GitHub release (latest SemVer) Go Report Card codecov

mockery provides the ability to easily generate mocks for Golang interfaces using the stretchr/testify/mock package. It removes the boilerplate coding required to use mocks.

Documentation

Documentation is found at out GitHub Pages site.

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 ./...

Development Efforts

v1

v1 is the original version of the software, and is no longer supported.

v2

mockery is currently in v2, which originally included cosmetic and configuration improvements over v1, but also implements a number of quality-of-life additions.

v3

v3 will include a ground-up overhaul of the entire codebase and will completely change how mockery works internally and externally. The highlights of the project are:

  • Moving towards a package-based model instead of a file-based model. mockery currently iterates over every file in a project and calls package.Load on each one, which is time-consuming. Moving towards a model where the entire package is loaded at once will dramatically reduce runtime, and will simplify logic. Additionally, supporting only a single mode of operation (package mode) will greatly increase the intuitiveness of the software.
  • Configuration-driven generation. v3 will be entirely driven by configuration, meaning:
    • You specify the packages you want mocked, instead of relying on it auto-discovering your package. Auto-discovery in theory sounds great, but in practice it leads to a great amount of complexity for very little benefit.
    • Package- or interface-specific overrides can be given that change mock generation settings on a granular level. This will allow your mocks to be generated in a heterogeneous manner, and will be made explicit by YAML configuration.
  • Proper error reporting. Errors across the board will be done in accordance with modern Golang practices
  • Variables in generated mocks will be given meaningful names.

Stargazers

Stargazers over time

mockery's People

Contributors

ajrharris avatar atombender avatar cam72cam avatar colonelpanic8 avatar cszczepaniak avatar dakiva avatar dillonstreator avatar dlwyatt avatar dwlnetnl avatar emmanuel099 avatar ernesto-jimenez avatar evanphx avatar gaffo avatar georgysavva avatar grongor avatar hikyaru-suzuki avatar hohmannr avatar jokly avatar joshk0 avatar kbolino avatar landontclipp avatar mateusmarquezini avatar mkatychev avatar nmiyake avatar rangelreale avatar rogchap avatar ryanbrainard avatar sirsova avatar tamccall avatar tehbilly avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.