Sounds like they are patching objects in memory. Trompeloeil, for example, doesn't do that.
That’s gonna be a big no from me, dawg.
I still recomend hand written fakes - but only because and if they model real behavior without the unwanted effects. I find my handwritten cods often has more lines of test code to ensure it works than the real implementation.
That's how I was looking at this since that's the experience I've had with mocks. For example, mocking an API to test a library that uses that API without incurring the real usage costs everytime the tests are ran. Going back over the github again, I can see this being useful if you have to fake a lot of APIs. Though my personal preference would always be to limit mocks as much as possible even with that framework available.
Years ago we decided that the data directory would be changeable so we call get data directory - that call is an easy constant in production not worth testing, but in test mode it is a complex call to make temp dir, setup the default contents (which might be real default or a test specific situation), then destroy it when the test is done. So a lot of tests are needed to get it right (everyone uses it)- however because we have this we can use a sqlite in our tests thus saving needing to mock the database: side effects from database manipulation no longer matter.
I do a similar thing for dbus, want to use the systembus - in tests I intercept your open call and launch new server on a different port just for this test. Again a lot of tests.
For time I intercept all the timer and get time calls. When in tests I have an advanceTime function that advances all the timers the intended amount and takes action If you advance 100ms a 10ms timer will fire 9-10 times before the 100ms timer you (9-10 because the last time both timers will fire and which is first depends)
The above is real world things I've done and found very useful for long enough that I'm trying to spread it. I believe that it would help everyone to start doing the same.
https://learn.microsoft.com/en-us/visualstudio/test/isolatin...