test: Introduce fakes for app config#61220
Conversation
And use it in some tests Signed-off-by: Louis Chmn <louis@chmn.me>
586292c to
3ae19a2
Compare
And use it in some tests Signed-off-by: Louis Chmn <louis@chmn.me>
|
This is more of a convenience helper, right? Because mocks already allow us to have that |
My problem with mocks is that it is super lengthy to configure all the expected interactions that the tested method will have. Also, it binds the test to the implementation, so every time the implementation changes, the test needs to change too. Currently, this is rather an experiment, I'll try to pick it up again when I have time. |
|
I agree for tests that use the (App) config should be arranged like Just my 2c |
The goal is to reduce the dependence of most tests on actual implementation and in the end the database.
This also make it much easier to prepare the environment for tests.
I used the fake in some tests to try out, and it is indeed easy and clean.