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
Note: I've now embedded a helper function to set up patchguards in SetupSuite() and unpatch in TearDownSuite(). That seems to work. Now I'm looking for a way to sequentially patch in different monkeys. As in, first call should call fakeMethod1(), second call should call fakeMethod2(), and so on.
Something like sm.PatchSequence(patchMe func(), returnMe ...func())
monkey patch is still a hack tool to do the test stuff, it has too many limitations, eg. cannot run tests in parallel, broken compatibility when update happen .etc
we only use it to do the patch when the mock is too hard to write
To my amazement and joy this worked from the outset on an M1 Mac in Goland with Go 1.19.1! Unlike another package I won't name.
My question now is, where the best place would be to integrate with Testify as the test framework?
Having to set up the mock in every single package that uses my to-be-monkeyed methods/funcs would be highly annoying (doable, but annoying).
Unfortunately Testify doesn't have a "super-test-setup" that you can do once and every Suite setup receives. At least as far as I saw in the doco.
Any ideas?
The text was updated successfully, but these errors were encountered: