testify
testify copied to clipboard
A toolkit with common assertions and mocks that plays nicely with the standard library
This assertion fails, when I expect it to succeed: ```go strOne := "foo" strTwo := "foo" assert.Equal( t, map[*string]string{&strOne: "foo"}, map[*string]string{&strTwo: "foo"}, ) ```
We have many reasons why we need to skip particular tests. I needed to provide for skipping a test given some condition depending on the environment the tests are running...
Fixes #625 Race conditions were triggered when Sprintf-ing certain objects when preparing a diff for mock failures. This restores the order of sprintf(obj) calls to the order it was prior...
## Summary If `TESTIFY_COLOR=true` is in the environment, then `expected` and `actual` values will be coloured in green and red respectively. ## Motivation Stolen from #994: > 1. @boyan-soubachov says...
I've found that `Eventually` is not really useful: 1. I can't use assertions inside `condition`. 1. Error message doesn't help to understand failure cause: `Condition never satisfied`. So I use...
The package `github.com/pmezard/go-difflib` is as of this commit no longer maintained: https://github.com/pmezard/go-difflib/commit/1ef1646f464bff6853dfa4c32750886762dc023a Maybe we could move the used functionality into this repo and stop depending on the `difflib` package all...
**Summary** The assertion package is useful for non-test assertions using things such as `assert.ObjectsAreEqualValues`. Similarly it would be useful to export the `assert.includeElement` function that is used by `assert.Contains` to...
in testify/suite/suite_test.go ```golang // SuiteGoroutineRace is intended to test there should be no race when creating // goroutine in tests. type SuiteGoroutineRace struct{ Suite } // TestSuiteRequireTwice... func TestSuiteGoroutineRace(t *testing.T)...
Scenario: I have a function that is used in a lot of places, and I have to change the function signature, adding a new parameter. All of the mocks of...
## Summary Add support for fuzz tests as introduced in Go 1.18 (still beta) and documented [here](https://go.dev/doc/fuzz/). Some additional implementation details are available in this [blog post](https://jayconrod.com/posts/123/internals-of-go-s-new-fuzzing-system). ## Changes TBD...