3 ms·
It is easy to do mocks wrong. Here is however an example of how one does it right. Say you have a system that accepts input, does something with it and stores
by eitland 3y ago
It is easy to do mocks wrong.
Here is however an example of how one does it right.
Say you have a system that accepts input, does something with it and stores it to some storage.
You don't want to touch actual storage in the build pipeline.
Then you mock in testing out the storage.
Everything can still be tested:
- the validation of incoming stuff isn't affected at all
- the transformations aren't affected
- the only difference is your tests now read the output back from a memory location instead of from a permanent storage somewhere