3 ms·
The problem with unit tests + heavy mocking is that you essentially makes any sort of class reorganisation as a massive pain. I try for sociable unit tests(it'
by UK-Al05 7y ago
The problem with unit tests + heavy mocking is that you essentially makes any sort of class reorganisation as a massive pain.
I try for sociable unit tests(it's a thing), which classes that are expected to work together 100% of the time are tested together. Mock out the external dependencies(http etc) or things that are expected to change.
I tend to only mock out/simulate primary ports(inputs, such http requests), and secondary ports(databases calls) for simple web apps.
I may start isolating stuff for testing purposes when it can be used well independently such a piece of middleware, or things that can be used by multiple parts of a project.
The main difference socaiable unit tests, and integration tests is that traditional integration tests still talk to the db.