-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Labels
assert.EqualValuesAbout equalityAbout equalitypkg-assertChange related to package testify/assertChange related to package testify/assertpkg-requireChange related to package testify/requireChange related to package testify/require
Description
Hello,
Is there a way to ignore certain fields when asserting equal or as the argument of .On?
e.g.
type A struct {
Name string
UpdatedAt time.Time `mock: "ignore"`
}
expected := A{
Name: "Expected Name"
}
mocks.MockController.On("Update", expected).Return(whatever)
...
We don't really care about the UpdateAt time, and this would also apply to random UUID's etc.
Otherwise we would have to assert each sub field in order for the test to pass.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
assert.EqualValuesAbout equalityAbout equalitypkg-assertChange related to package testify/assertChange related to package testify/assertpkg-requireChange related to package testify/requireChange related to package testify/require