|
|
|
|
|
by aleksiy123
919 days ago
|
|
To some extent this is pretty much the same as mocking. You are still injecting fake data into your pure logic functions whether its through their parameters or by them calling a mock. I agree preferable but sometimes you want to test the logic of the code thats actually making decisions about how and when the IO is called. You can do it with integration tests of course but in more complex environments with lots of complex IO dependencies mocking is cheaper. Its also hard to simulate specific failures in integration tests like a specific request failing. Pretty much mocking with extra steps. So mocking has its place as well. |
|