{"repo":"stretchr/testify","free":true,"listed":false,"github":"https://github.com/stretchr/testify","clone":"git clone https://github.com/stretchr/testify.git","description":"A toolkit with common assertions and mocks that plays nicely with the standard library","language":"Go","stars":26162,"topics":["testify","go","assertions","mocking","golang","testing","toolkit"],"license":"MIT","category":"dev-tools","readme_excerpt":"Testify - Thou Shalt Write Tests ================================ [!NOTE] Testify is being maintained at v1, no breaking changes will be accepted in this repo. See discussion about v2. Go code (golang) set of packages that provide many tools for testifying that your code will behave as you intend. Features include: Easy assertions Mocking Testing suite interfaces and functions Get started: Install testify with one line of code, or update it with another For an introduction to writing test code in Go, see https://go.dev/doc/code#Testing Check out the API Documentation https://pkg.go.dev/github.com/stretchr/testify Use testifylint (via golangci-lint) to avoid common mistakes A little about Test-Driven Development (TDD) assert package ------------------------------------------------------------------------------------------- The assert package provides some helpful methods that allow you to write better test code in Go. Prints friendly, easy to read failure descriptions Allows for very readable code Optionally annotate each assertion with a message See it in action: Every assert func takes the testing.T object as the first argument. This is how it writes the errors out through the normal go test capabilities. Every assert func returns a bool indicating whether the assertion was successful or not, this is useful for if you want to go on making further assertions under certain conditions. if you assert many times, use the below: require package ------------------------------------","default_branch":null,"files":null,"tree":[],"storefront":"/r/stretchr","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/stretchr/testify/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}