Only mock your own interfaces. That is one of my rules of thumb for writing robust unit tests.
When you mock/stub third-party interfaces, you will encode your expectation of what the real component would do, which may differ from what it would actually do. If you failed to anticipate the correct behavior when you wrote the code under test, you will likely encode that same incorrect behavior in your mock.
https://henko.net/blog/only-mock-your-own-interfaces/
[#]programming #unittesting #testing
=> More informations about this toot | View the thread | More toots from henrikjernevad@mastodon.social
=> View programming tag | View unittesting tag | View testing tag This content has been proxied by September (3851b).Proxy Information
text/gemini