Hacker GitHub

← All repos

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

Mentions per year 25 mentions · busiest year 2020 (5)
20082026
  1. Ah this is interesting. I've been blindly using this library for the past 6 years: https://github.com/stretchr/testify .
  2. …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.
  3. …- 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
  4. …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
  5. …[0] assertions and possibly a test suite. Then it'd be easier to add additional test cases. [0] https://github.com/stretchr/testify
  6. …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
  7. > it doesn't have any As/Is support It does: https://pkg.go.dev/github.com/stretchr/testify@v1.7.0/assert...
  8. …(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…
  9. …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
  10. …During development I recommend: https://github.com/golangci/golangci-lint and https://github.com/stretchr/testify
  11. 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…
  12. …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…
  13. …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
  14. …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
  15. …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
  16. …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…
  17. …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?
  18. 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…
  19. 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?
  20. …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
  21. 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
  22. …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