Testy is a library for writing meaningful and readable tests. Testy is typesafe (using generics), based on go-cmp, and designed as an alternative to t

GitHub - peterldowns/testy: testy is a library for writing meaningful and readable tests

submited by
Style Pass
2023-05-24 00:00:04

Testy is a library for writing meaningful and readable tests. Testy is typesafe (using generics), based on go-cmp, and designed as an alternative to testify, gotools.test, and is.

This page is the primary source for documentation. The code itself is supposed to be well-organized, and each function has a meaningful docstring, so you should be able to explore it quite easily using an LSP plugin, reading the code, or clicking through the go.dev docs.

Testy helps you write more usable, readable, and meaningful tests. By allowing you to determine between checks (soft assertions) and asserts (hard assertions), and providing structuring helpers, you can make debugging much easier on your teammates and your future self.

Testy attempts to strike a balance between allowing explicit and meaningful tests, encouraging standard golang coding conventions, avoiding implementation magic, and minimizing the number of check methods to choose between when writing tests. Here's everything you need to know:

check contains methods for checking a condition, marking a test failed if the condition is not met. This is a "soft" style assert, equivalent to the methods in testify/assert or the Check method in gotest.tools/assert.

Leave a Comment