Henrik Jernevad on Nostr: Only mock your own interfaces. That is one of my rules of thumb for writing robust ...
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
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