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
We use testify mocks for mocking objects while testing (uses reflect.DeepEqual to compare).
We are using FSM on a model (has FSM property) and when this object is passed around to repo layer for saving, we mock the Save method in our tests. The problem is that, the tests fail because ob.FSM property doesn't match with the expected object's property.
To work around this we have to strip the FSM property (set ob.FSM = nil) and pass it to Save so that the object matching is successful. Is there a correct way to handle this?
The text was updated successfully, but these errors were encountered:
We use testify mocks for mocking objects while testing (uses
reflect.DeepEqual
to compare).We are using FSM on a model (has
FSM
property) and when this object is passed around to repo layer for saving, we mock theSave
method in our tests. The problem is that, the tests fail becauseob.FSM
property doesn't match with the expected object's property.To work around this we have to strip the FSM property (set
ob.FSM = nil
) and pass it toSave
so that the object matching is successful. Is there a correct way to handle this?The text was updated successfully, but these errors were encountered: