A collection of Go packages that extend the standard testing package with utilities for assertions, golden files, and common testing patterns.
gotest.tools is a collection of Go packages that extend the standard testing package with utilities for common testing patterns. It provides tools for assertions, golden file comparisons, filesystem operations, command execution testing, and asynchronous code testing, helping developers write more comprehensive and maintainable tests.
Go developers who need enhanced testing capabilities beyond the standard testing package, particularly those working on CLI tools, filesystem operations, or asynchronous code that requires robust testing utilities.
Developers choose gotest.tools because it offers modular, focused packages that solve specific testing problems without introducing unnecessary dependencies, making it easy to adopt incrementally while maintaining compatibility with Go's native testing framework.
A collection of packages to augment the go testing package and support common patterns.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Each package like assert, golden, or fs operates independently without pulling in unnecessary dependencies, aligning with Go's simplicity and allowing incremental adoption.
The golden package enables comparing large multi-line outputs against stored files, ideal for CLI tool testing and preventing regression with easy updates via flags.
env package provides isolated setting and cleanup of environment variables, ensuring test reproducibility and preventing side effects across tests.
poll package offers utilities to test async code by polling for state changes, useful for integration tests with external systems or delayed responses.
Gotest.tools lacks a dedicated mock package, requiring developers to refer to external wiki patterns for test doubles or use other libraries, adding complexity.
The assert package provides functional comparisons but has fewer matchers and less expressive syntax than competitors like testify, limiting complex test conditions.
Using multiple discrete packages can increase boilerplate and require careful dependency management, especially in large test suites with diverse needs.