Hacker News new | ask | show | jobs
by tobyhinloopen 515 days ago
It kinda depends on your architecture. If you can run integration tests for cheap, it makes sense to favor them over smaller unit tests.

I like to design my applications so all slow components can be mocked by faster alternatives, and have the HTTP stack as thin as possible so I can basically call a function and assert the output, while the output closely resembles the final HTTP response, either rendering a template with a blob of data, or rendering the blob of data as JSON.