oliverdavies.uk/content/node.c3f7faac-7bf4-434f-b89f-938adb18c395.json

100 lines
3.4 KiB
JSON
Raw Normal View History

2025-04-16 23:34:31 +01:00
{
"uuid": [
{
"value": "c3f7faac-7bf4-434f-b89f-938adb18c395"
}
],
"langcode": [
{
"value": "en"
}
],
"type": [
{
"target_id": "daily_email",
"target_type": "node_type",
"target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7"
}
],
"revision_timestamp": [
{
"value": "2025-04-16T14:13:01+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": "Why I prefer integration tests to unit tests\n"
}
],
"created": [
{
"value": "2023-11-14T00:00:00+00:00"
}
],
"changed": [
{
"value": "2025-04-16T14:13:01+00:00"
}
],
"promote": [
{
"value": false
}
],
"sticky": [
{
"value": false
}
],
"default_langcode": [
{
"value": true
}
],
"revision_translation_affected": [
{
"value": true
}
],
"path": [
{
"alias": "\/daily\/2023\/11\/14\/why-i-prefer-integration-tests-to-unit-tests",
"langcode": "en"
}
],
"body": [
{
"value": "\n <p>With unit tests, you need to mock <strong>everything<\/strong>.<\/p>\n\n<p>If what you're testing has a dependency, you need to create and use a mock version.<\/p>\n\n<p>If the mock has its own dependencies, you need to mock those, too.<\/p>\n\n<p>I've written unit tests with mocks and accidentally only tested the mocks instead of the functionality I intended.<\/p>\n\n<h2 id=\"here%27s-the-thing\">Here's the thing<\/h2>\n\n<p>With integration tests, you can use and test the real dependencies.<\/p>\n\n<p>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.<\/p>\n\n ",
"format": "full_html",
"processed": "\n <p>With unit tests, you need to mock <strong>everything<\/strong>.<\/p>\n\n<p>If what you're testing has a dependency, you need to create and use a mock version.<\/p>\n\n<p>If the mock has its own dependencies, you need to mock those, too.<\/p>\n\n<p>I've written unit tests with mocks and accidentally only tested the mocks instead of the functionality I intended.<\/p>\n\n<h2 id=\"here%27s-the-thing\">Here's the thing<\/h2>\n\n<p>With integration tests, you can use and test the real dependencies.<\/p>\n\n<p>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.<\/p>\n\n ",
"summary": null
}
],
"feeds_item": [
{
"imported": "2025-04-16T14:13:01+00:00",
"guid": null,
"hash": "b38408f033b23dc55649c0a05a3af78b",
"target_type": "feeds_feed",
"target_uuid": "90c85284-7ca8-4074-9178-97ff8384fe76"
}
]
}