testify
testify copied to clipboard
A toolkit with common assertions and mocks that plays nicely with the standard library
## Summary Fix string interpolation issues using `%s` instead of `%#v` ## Changes Switch `%s` with `%#v` inside error messages in func `Len()` use `err.Error()` instead of only `err` to...
Fixes #608. Added `unexpected Call[]`, If we don't need to consider multiple `recover()` flow with same mock call, then could replace this with `unexpected Call`. # Related #608
In a nutshell: this test passes, despite the expectations being incorrect: https://go.dev/play/p/2r54p3TxXqr ```go package durable import ( "testing" "github.com/stretchr/testify/mock" ) type mymock struct { mock.Mock } func (m *mymock) Run()...
`Equal` and `EqualValues` print uints in hex format when showing diff. It would be much more useful to see `1701`, instead of `0x6a5`. ``` Error Trace: equality_test:34 Error: Not equal:...
## Summary Clarify that the link in question points to the default testing framework, not `testify`. ## Changes Add clause `using its default testing framework` ## Motivation It wasn't immediately...
This question follows this PR - https://github.com/stretchr/testify/pull/1567 - https://github.com/stretchr/objx/pull/140 Context: objx depends on testify for its tests, testify depends on objx for the code (I didn't check where). I opened...
From PR #254: Best thing to do to facilitate integration into tools like vim-go would be to align with the output from `go test`. Stdlib prints a single line per...
`assert.HTTPSuccess()` is failing in my case when my code does `r *http.Request` `ioutil.ReadAll(r.Body)`. I believe that https://github.com/stretchr/testify/blob/f35b8ab0b5a2cef36673838d662e249dd9c94686/assert/http_assertions.go#L13 should create body (even empty).
## Summary fixes the method [`Mock.IsMethodCallable`](https://pkg.go.dev/github.com/stretchr/testify/mock#Mock.IsMethodCallable) and respective unit test ## Changes calling findExpectedCall to check if the call is expected and repeatability is not equal to -1, if Yes...
Since Go 1.9 The [`testing.T`](https://pkg.go.dev/testing/#T.Helper)/[`testing.B`](https://pkg.go.dev/testing/#B.Helper)/[`testing.F`](https://pkg.go.dev/testing/#F.Helper) and more generally the [`testing.TB`](https://pkg.go.dev/testing/#TB) interface all have an [`Helper()`]((https://pkg.go.dev/testing/#T.Helper)) method that must be used by test helpers to hide them in the caller stack...