Add daily emails and archive

This commit is contained in:
Oliver Davies 2024-01-03 20:00:00 +00:00
parent 7ec664a810
commit e2b6832598
379 changed files with 11132 additions and 0 deletions

View file

@ -0,0 +1,26 @@
---
title: >
Why I prefer integration tests to unit tests
pubDate: 2023-11-14
permalink: >-
archive/2023/11/14/why-i-prefer-integration-tests-to-unit-tests
tags:
- software-development
- automated-testing
- test-driven-development
- mocking
---
With unit tests, you need to mock __everything__.
If what you're testing has a dependency, you need to create and use a mock version.
If the mock has its own dependencies, you need to mock those, too.
I've written unit tests with mocks and accidentally only tested the mocks instead of the functionality I intended.
## Here's the thing
With integration tests, you can use and test the real dependencies.
Whilst they may be slightly slower to run, I prefer the simpler setup, less need for mocks, and knowing the real services work - not just the mocked versions.