oliverdavies.uk/content/node.178c6bab-7e28-413a-9055-24fac0de0d0a.yml

69 lines
2.7 KiB
YAML

uuid:
- value: 178c6bab-7e28-413a-9055-24fac0de0d0a
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:26+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: |
Adding snapshot tests to Build Configs
created:
- value: '2023-12-16T00:00:00+00:00'
changed:
- value: '2025-05-11T09:00:26+00:00'
promote:
- value: false
sticky:
- value: false
default_langcode:
- value: true
revision_translation_affected:
- value: true
path:
- alias: /daily/2023/12/16/adding-snapshot-tests-to-build-configs
langcode: en
body:
- value: |
<p>This week, I've started to add snapshot tests to the <a href="https://www.oliverdavies.dev/build-configs">Build Configs project</a>.</p>
<p>I had unit tests for the DTO validation to ensure the configuration was correct, but the main thing I wanted to test was I could run it for a given configuration file and get the expected files and contents to be generated.</p>
<p>With snapshot tests, I generate the files for each configuration and compare them to a set that I know to be correct.</p>
<p>If the files match, the tests pass, but, if they don't - such as a bug in the code, the tests will fail.</p>
<p>This is the level that I want to be testing this project and that provides the most value.</p>
<p>If a snapshot test fails, I can try to replicate the underlying issue in a unit test whilst also fixing the snapshot test.</p>
format: full_html
processed: |
<p>This week, I've started to add snapshot tests to the <a href="https://www.oliverdavies.dev/build-configs">Build Configs project</a>.</p>
<p>I had unit tests for the DTO validation to ensure the configuration was correct, but the main thing I wanted to test was I could run it for a given configuration file and get the expected files and contents to be generated.</p>
<p>With snapshot tests, I generate the files for each configuration and compare them to a set that I know to be correct.</p>
<p>If the files match, the tests pass, but, if they don't - such as a bug in the code, the tests will fail.</p>
<p>This is the level that I want to be testing this project and that provides the most value.</p>
<p>If a snapshot test fails, I can try to replicate the underlying issue in a unit test whilst also fixing the snapshot test.</p>
summary: null
field_daily_email_cta: { }