stretchr/testify
View on GitHub ↗ ★ 26,240 Go
A toolkit with common assertions and mocks that plays nicely with the standard library
25 mentions on Hacker News by 23 people: 3 stories, 22 comments · first 2016-05-01 · latest 2025-08-06
20082026
-
Ah this is interesting. I've been blindly using this library for the past 6 years: https://github.com/stretchr/testify .
comment by bradhe · 2025-08-06 · in Show HN: Should – Expressive Assertions for Go -
▲ 1
Show HN: Testify mock without the boilerplate (Golang)story by razzie · 2025-01-01 · 0 comments
-
…tests - https://go.dev/wiki/TableDrivenTests . Going beyond what's built in, get familiar with https://github.com/stretchr/testify as that's used a lot.
comment by karolist · 2024-08-03 · in Full Introduction to Golang with Test-Driven Development -
▲ 2
Show HN: Testy, a better Golang testing librarystory by peter_l_downs · 2023-05-23 · 0 comments
-
…- generate String() - https://mvdan.cc/gofumpt - stricter gofmt - https://github.com/stretchr/testify - test assertion library - https://github.com/rs/zerolog - logging - https://github.com/spf13/cobra - CLI framework FWIW,
comment by jzelinskie · 2023-05-23 · in How to start a Go project in 2023 -
…database-related codepaths and logic, which for most business apps is everything important. [0] https://github.com/stretchr/testify [1] https://github.com/stretchr/testify/issues/1147
comment by peter_l_downs · 2023-05-21 · in Ask HN: What's your favorite software testing framework and why? -
▲ 1
Testify – Thou Shalt Write Testsstory by maydemir · 2022-02-13 · 0 comments
-
…[0] assertions and possibly a test suite. Then it'd be easier to add additional test cases. [0] https://github.com/stretchr/testify
comment by kjgkjhfkjf · 2021-11-16 · in Show HN: Caffeine – Minimum viable back end for prototyping -
…thing, then use testify, because they definitely have been thinking about this long enough to get it right: github.com/stretchr/testify
comment by dbt00 · 2021-03-30 · in Down the Golang Nil Rabbit Hole -
> it doesn't have any As/Is support It does: https://pkg.go.dev/github.com/stretchr/testify@v1.7.0/assert...
comment by llimllib · 2021-02-24 · in Add experimental fuzz test support for Go 1.17 -
…(wtf), and... And at this point, I just stopped digging down that rabbit hole and instead added TESTIFY := github.com/stretchr/testify and mkdir -p "$(GOPATH)/src/$(TESTIFY)" ; git clone --depth 1 --branch v1.3.0 https://$(TESTIFY).git…
comment by Joker_vD · 2020-09-16 · in Go’s Major Versioning Sucks – From a Fanboy -
…go.mod?) yes does the repository use semver? yes is the major version <= 1? yes => normal versioning, e.g. github.com/stretchr/testify v1.3.0 no => when importing, we need add /vN at the end, e.g., import "github.com/my/mod/v4", and in…
comment by m0th87 · 2020-07-07 · in Keeping your Go modules compatible -
…During development I recommend: https://github.com/golangci/golangci-lint and https://github.com/stretchr/testify
comment by sandreas · 2020-05-27 · in Diving into Go by building a CLI application -
I’m responsible for a few repos, probably the most famous one being github.com/stretchr/testify. My solution is that as much as I love open source and the community I’m in, I do not let it get in the way of work and family. I’ll only…
comment by ununoctium87 · 2020-05-18 · in Ask HN: Dear open source devs how do you sustain yourself -
…tps://github.com/julienschmidt/httprouter - Testing: https://golang.org/pkg/testing/ + https://pkg.go.dev/mod/github.com/stretchr/testify - Mocks: https://github.com/golang/mock - Dependency Injection: None, current user of…
comment by bithavoc · 2020-04-16 · in Ask HN: How are you using Go to write production-grade back end services? -
…order That's interesting, in my head (expected, actual) is the usual order. For example, https://godoc.org/github.com/stretchr/testify/require#Equal .
comment by oconnor663 · 2019-04-19 · in Learning Parser Combinators with Rust -
…people to depend on the master branch. And even this PR acknowledges the issues that has caused: https://github.com/stretchr/testify/pull/274 . I agree that there are workable workarounds. But that's exactly what they are. Workarounds.
comment by nstart · 2018-03-27 · in A Proposal for Package Versioning in Go -
…generally use the testify assert package for convenience[0], but it’s not strictly necessary. [0]: https://github.com/stretchr/testify
comment by ovao · 2018-01-03 · in What I learned in 2017 writing Go -
…in testify (the message is logged that you specify, and the test is immediately stopped). https://github.com/stretchr/testify/blob/master/require/requ... I get a lot of the rationale behind the standard way ethos. I think this is just a…
comment by rsvihla · 2017-12-11 · in Ask HN: How to approach testing in Golang? -
…Testify [0] for asserts and mocks, and Mockery (based on Testify) [1] to generate mocks. [0] https://github.com/stretchr/testify [1] https://github.com/vektra/mockery
comment by closeparen · 2017-12-11 · in Ask HN: How to approach testing in Golang? -
Check out https://github.com/stretchr/testify for more convenient assertions, as well as mocking support for implementing interfaces within your tests. You cannot do ad-hoc mocking of arbitrary functions in Go. If you want to write…
comment by terom · 2017-12-11 · in Ask HN: How to approach testing in Golang? -
If you want to make testing a bit less verbose, you can look into testify ( https://github.com/stretchr/testify ), it adds some helpful assertions (no more 'if err != nil ...'). If you are using interfaces with dependency injection, it is…
comment by GhostVII · 2017-12-11 · in Ask HN: How to approach testing in Golang? -
…suite. (Also, the default coverage metrics are very very weak. But I love Go just the same.) [0]: https://github.com/stretchr/testify
comment by biztos · 2016-11-10 · in Seven years of Go -
For your unit-testing problem, I highly recommend `testify/assert`: https://godoc.org/github.com/stretchr/testify/assert
comment by biztos · 2016-08-02 · in I Love Go; I Hate Go -
…for front-end (ugh, this is the harder part) - The testing library in stdlib plus maybe [testify]( https://github.com/stretchr/testify ) - etc... Many nice things are missing. Some were [shamelessy copied by other people](…
comment by andreynering · 2016-05-01 · in Go best practices, six years in