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 469 testify issues
Sort by recently updated
recently updated
newest added

## Summary Correct invalid examples in require package doc comments. require does not return a boolean value; its responsibility is to fail immediately. ## Changes Updated examples to reflect proper...

documentation
pkg-require
internal/codegen

## Summary Reorganize GitHub Actions workflows to run tests the same way on all Go versions, and so remove running tests from the 'build' jobs (which run job only on...

## Description Because assert.Regexp uses [regexp.MustCompile](https://pkg.go.dev/regexp#MustCompile) which is for "initialization of global variables holding compiled regular expressions" a runtime panic is possible. We should use Compile and handle the error....

bug
pkg-assert

Reference: https://github.com/Antonboom/testifylint/issues/81#issuecomment-3290922001 The Regexp and NotRegexp assertion accept `interface{}` for the rx (expression) argument. This is insane but we can't change it because it would be a breaking change. The...

documentation
pkg-assert

This is a fairly contrived example, I admit. But this was a real head-scratcher in the wild. The following code will never complete. ``` package main import ( "fmt" "github.com/stretchr/testify/mock"...

bug
pkg-mock

## Description The doc comments for multiple functions in the `require` package have code examples that are invalid. Example: https://github.com/stretchr/testify/blob/a53be35c3b0cfcd5189cffcfd75df60ea581104c/require/require.go#L1391 The example reads: ```go if require.NoError(t, err) { require.Equal(t, expectedObj,...

bug
good first issue
documentation

## Description If we want to check multiple conditions inside `Never`, currently, we have to do ```go assert.Never(t, func() bool { if GetVal1() == 1 { return true } if...

enhancement

## Summary Modify assert.Same and assert.NotSame to support comparing maps and channels by pointer equality. ## Changes 1. Rename `samePointers` to `sameReferences` and generalize it so it will try comparing...

## Summary Fixes a data race when using assert.Eventually so the variables can be safely used after a timeout This was found in my test code when the eventually timed...