You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice if the next version used a syntax similar to stretchr/testify. Since t is passed in to New() we shouldn't need to pass it in again for each assertion.
See this example from stretchr/testify:
package yours
import (
"testing""github.com/stretchr/testify/assert"
)
funcTestSomething(t*testing.T) {
assert:=assert.New(t)
// assert equalityassert.Equal(123, 123, "they should be equal")
// assert inequalityassert.NotEqual(123, 456, "they should not be equal")
// assert for nil (good for errors)assert.Nil(object)
// assert for not nil (good when you expect something)ifassert.NotNil(object) {
// now we know that object isn't nil, we are safe to make// further assertions without causing any errorsassert.Equal("Something", object.Value)
}
}
It would be nice if the next version used a syntax similar to stretchr/testify. Since
t
is passed in toNew()
we shouldn't need to pass it in again for each assertion.See this example from stretchr/testify:
For goldie it would look like this:
If there is interest, I would be happy to make a PR.
The text was updated successfully, but these errors were encountered: