Go unit-testing

Open-source Go projects categorized as unit-testing

Top 12 Go unit-testing Projects

  • chromedp

    A faster, simpler way to drive browsers supporting the Chrome DevTools Protocol.

    Project mention: How can I do infinte scroll with go http | reddit.com/r/golang | 2022-11-16

    You could use something like the chrome dev tools (https://github.com/chromedp/chromedp) or look into JS runtimes in Go and try to handle the I/O yourself.

  • dockertest

    Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.

    Project mention: Mocking database calls without a library? | reddit.com/r/golang | 2023-02-07

    Don't mock. Use https://github.com/ory/dockertest to actually run tests against a dockerized DB.

  • SonarQube

    Static code analysis for 29 languages.. Your projects are multi-language. So is SonarQube analysis. Find Bugs, Vulnerabilities, Security Hotspots, and Code Smells so you can release quality code every time. Get started analyzing your projects today for free.

  • keploy

    Testing for Developers. Toolkit that creates test-cases and data mocks from API calls, DB queries, etc.

    Project mention: Test generating tools - future of test automation? | reddit.com/r/webdev | 2022-12-21

    I recently discovered Keploy (https://github.com/keploy/keploy) and was really impressed by its promise that it can generate API tests with code coverage by itself just by recording API calls and mocking everything that goes outside of the application - including calls to external API endpoints and the database. It seems like a super useful tool and potentially a game changer, especially now that GPT is starting another wave of automation.

  • service-pattern-go

    Simple clean Go REST API architecture with dependency injection and mocking example, following SOLID principles.

    Project mention: Question about the service pattern and data racing in Go | reddit.com/r/golang | 2022-05-26

    Repo for reference: https://github.com/irahardianto/service-pattern-go

  • testza

    Full-featured test framework for Go! Assertions, fuzzing, input testing, output capturing, and much more! 🍕

    Project mention: Testza: A full-featured go testing framework with developer-friendly output | reddit.com/r/golang | 2022-04-01
  • got

    An enjoyable golang test framework. (by ysmood)

    Project mention: An enjoyable golang test framework | reddit.com/r/golang | 2022-04-27
  • test-at-scale

    TAS is an intelligent test execution platform for engineering teams to achieve high development velocity.

    Project mention: 2x faster, smarter test execution with Test At Scale written in Go | reddit.com/r/golang | 2022-06-03

    Check out their Go codebase at https://github.com/lambdatest/test-at-scale

  • InfluxDB

    Build time-series-based applications quickly and at scale.. InfluxDB is the Time Series Platform where developers build real-time applications for analytics, IoT and cloud-native services. Easy to start, it is available in the cloud or on-premises.

  • dbcleaner

    Clean database for testing, inspired by database_cleaner for Ruby

    Project mention: The Big Unit Test Misunderstanding | news.ycombinator.com | 2022-03-21

    It is not hard to isolate and stub a database the problem is you will not catch a lot of errors, e.g. writing a 40 char string into a VCHAR(10), DateTime conversations, ...

    In Ruby on Rails it is quite common to use a real database in the unit tests. Even before containers came out and it is still fast (yes, less than 1 second).

    In rails you use the same database instance for all the tests, so you do not have spin up a database instance for every case. Instead you use a database cleaner.

    There also exists a JS implementation: https://github.com/khaiql/dbcleaner

  • go-snaps

    Jest-like snapshot testing in Golang 📸

    Project mention: Snapshot testing in golang | reddit.com/r/golang | 2022-11-18

    https://github.com/gkampitakis/go-snaps. Have a look, feedback is always welcome.

  • mockit

    Library that make mocking of Go functions/methods easy (by pasdam)

  • golang-table-tests-with-testify-mock

    This repo shows how to test and mock multiple dependencies using table-driven tests with testify-mock in Golang

  • go-testpredicate

    Unit-testing predicates for Go.

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-02-07.

Go unit-testing related posts


What are some of the best open-source unit-testing projects in Go? This list will help you:

Project Stars
1 chromedp 8,594
2 dockertest 3,195
3 keploy 1,512
4 service-pattern-go 685
5 testza 409
6 got 261
7 test-at-scale 205
8 dbcleaner 148
9 go-snaps 48
10 mockit 13
11 golang-table-tests-with-testify-mock 10
12 go-testpredicate 5
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives