uuid: - value: 60d29f19-7871-4b8e-a2e5-3bf7edf17c00 langcode: - value: en type: - target_id: daily_email target_type: node_type target_uuid: 8bde1f2f-eef9-4f2d-ae9c-96921f8193d7 revision_timestamp: - value: '2025-05-11T09:00:20+00:00' revision_uid: - target_type: user target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849 revision_log: { } status: - value: true uid: - target_type: user target_uuid: b8966985-d4b2-42a7-a319-2e94ccfbb849 title: - value: 'Automated tests prevent you from adding regressions' created: - value: '2024-02-02T00:00:00+00:00' changed: - value: '2025-05-11T09:00:20+00:00' promote: - value: false sticky: - value: false default_langcode: - value: true revision_translation_affected: - value: true path: - alias: /daily/2024/02/02/automated-tests-prevent-you-from-adding-regressions langcode: en body: - value: |
Continuing from my last few emails, as well as adding the new use case more easily and quicker, having automated tests also saved me from adding a regression into the code I was changing.
I'd written a condition in the query to ensure only results that started with the search term.
Initially, I removed it, but then the tests failed.
This reminded me why I'd written the condition that way, and I was able to re-add my fix differently.
Without the tests, I'd likely have removed it and introduced a regression.
Whilst fixing a bug, I'd have introduced a different bug.
My tests saved me from doing that and I was able to rectify it quickly before pushing to CI or the staging environment.
format: full_html processed: |Continuing from my last few emails, as well as adding the new use case more easily and quicker, having automated tests also saved me from adding a regression into the code I was changing.
I'd written a condition in the query to ensure only results that started with the search term.
Initially, I removed it, but then the tests failed.
This reminded me why I'd written the condition that way, and I was able to re-add my fix differently.
Without the tests, I'd likely have removed it and introduced a regression.
Whilst fixing a bug, I'd have introduced a different bug.
My tests saved me from doing that and I was able to rectify it quickly before pushing to CI or the staging environment.
summary: null field_daily_email_cta: { }