-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
Description
The generated code contains this method:
// NewFoo creates a new instance of Foo. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewFoo(t interface {
mock.TestingT
Cleanup(func())
}) *Foo {I use testify mock for several months now, and just found that.
There seems to be no documentation for that:
At least not here: https://pkg.go.dev/github.com/stretchr/testify/mock
And not here: https://github.com/stretchr/testify
Is there a reason for that? I think that method is very handy, because it lets your test fail, instead of getting a random panic in another goroutine if you have an error in On(...).
ikonst