testify icon indicating copy to clipboard operation
testify copied to clipboard

A toolkit with common assertions and mocks that plays nicely with the standard library

Results 422 testify issues
Sort by recently updated
recently updated
newest added

### Discussed in https://github.com/stretchr/testify/discussions/1660 Originally posted by **n4nn31355** October 16, 2024 It's confusing and error-prone that `NotSame` checks nothing if any of the values is not a pointer. Is there...

good first issue

## Summary Comparing Infs should fail as described in related issue ## Related issues Closes #1662

```go func TestInEpsilon1(t *testing.T) { div := 0.0 require.InEpsilon(t, 1, 1/div, 0.001) } func TestInEpsilon2(t *testing.T) { div := 0.0 require.InEpsilon(t, 1/div, 1, 0.001) } ``` ``` > go test...

### Problem: Currently when asserting a specific enum value is set I have been using either `assert.Equal(t, val1, val1)` or `assert.Equal(t, val1.String(), val2.String())`. The first is, imo, better from the...

## Description I'm using this library indirectly, through `vektra/mockery`. I have a mock that I use in a goroutine, and I don't expect any calls on it. However, because of...

bug

## Description Out test suite uses `AssertExpectations(t TestingT) bool` which is great to ensure that all expected calls have been met. It has a small issue though when working with...

enhancement

## Description Hello, team! I was surprised, but `testify` allows to set non-string in `msgAndArgs...` if this is the single argument: https://github.com/stretchr/testify/blob/89cbdd9e7b39eb58896d316a7495597d3aba4371/assert/assertions.go#L290-L296 So I can do ```go assert.Equal(a, b, new(time.Time))...

enhancement

### Prerequisite ```go // ConvertibleTo reports whether a value of the type is convertible to type u. // Even if ConvertibleTo returns true, the conversion may still panic. // For...

enhancement

# Summary Instead of modifying the output as proposed in #1598, avoid any kind of output when trying to match calls. # Related #1597

bug
pkg-mock

It would be great if you could export the `diff()` function. Then it would be easier to create custom error messages. Example, I would like to avoid the two long...

enhancement