How do you control behaviour in mocked interface ?

This page summarizes the projects mentioned and recommended in the original post on /r/golang

InfluxDB - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • moq

    Interface mocking tool for go generate (by matryer)

  • I like the way of matryer/moq a lot. Basically, it generates a func for each of the methods of an interface, therefore the behaviour is clear to everyone without too much abstraction.

  • minimock

    Powerful mock generation tool for Go programming language

  • In our company projects we use https://github.com/gojuno/minimock for units

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • counterfeiter

    A tool for generating self-contained, type-safe test doubles in go

  • Another alternative to use would be counterfeiter, it generates a type from your interface that could be used as a mock, stub or spy. I wrote a short post covering that tool if you're interested.

  • mockery

    A mock code autogenerator for Go (by vektra)

  • I use mockery to generate mocks based on my interfaces: https://github.com/vektra/mockery

  • Testify

    A toolkit with common assertions and mocks that plays nicely with the standard library

  • I’m a fan of https://github.com/stretchr/testify

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Is gomock still maintained and recommended?

    7 projects | /r/golang | 6 Mar 2023
  • What mocking framework do you prefer?

    6 projects | /r/golang | 23 Oct 2021
  • I Write Tests in Go

    1 project | news.ycombinator.com | 10 Apr 2024
  • Direction of mockery: absorb different styles of mocks into this project · vektra mockery · Discussion #671

    1 project | /r/golang | 11 Jul 2023
  • Go: Write Mock Test cases using Mockery and

    1 project | dev.to | 10 May 2023