rapid icon indicating copy to clipboard operation
rapid copied to clipboard

Would like for *rapid.T to implement the Cleanup function like *testing.T

Open nbgraham opened this issue 2 years ago • 0 comments

From gomock:

// cleanuper is used to check if TestHelper also has the `Cleanup` method. A
// common pattern is to pass in a `*testing.T` to
// `NewController(t TestReporter)`. In Go 1.14+, `*testing.T` has a cleanup
// method. This can be utilized to call `Finish()` so the caller of this library
// does not have to.
type cleanuper interface {
	Cleanup(func())
}

I am using rapid with gomock and found some errors in my tests when I noticed that Finish was not being called on the mock controller after each Check

nbgraham avatar Aug 28 '23 21:08 nbgraham