<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/day-22-30-test-behaviour-d5kdwtggz" -->

---
title: Day 22/30 — Test Behaviour | daily.dev
description: A short testing philosophy piece for NestJS applications, arguing that tests should validate application behavior rather than implementation details like...
canonical: https://daily.dev/posts/day-22-30-test-behaviour-d5kdwtggz
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Day 22/30 — Test Behaviour | daily.dev
og:description: A short testing philosophy piece for NestJS applications, arguing that tests should validate application behavior rather than implementation details like...
og:url: https://daily.dev/posts/day-22-30-test-behaviour-d5kdwtggz
og:image: https://api.daily.dev/og/posts/D5kdwtGGz.png
og:image:alt: Day 22/30 — Test Behaviour
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Day 22/30 — Test Behaviour

**[Nestjs Developers](https://daily.dev/sources/nestjsdevs)** · [@ezilemdodana](https://daily.dev/ezilemdodana) · 1 min read · 12 upvotes · 2 comments

## Summary

A short testing philosophy piece for NestJS applications, arguing that tests should validate application behavior rather than implementation details like decorators. It outlines a practical layering strategy: unit tests for business logic, integration tests for infrastructure boundaries, and end-to-end tests for critical user journeys, with a call to pick the smallest test that catches the failure you care about.

## Content

Test what your application does, not how many decorators the class contains.

A practical NestJS testing approach:

- Unit tests for business decisions
- Integration tests for infrastructure boundaries
- End-to-end tests for critical user journeys

If every dependency is mocked, your tests may only prove that the mocks agree with each other.

If every test boots the whole application, feedback becomes slow and fragile.

Choose the smallest test capable of catching the failure you care about.

Which testing layer gives your project the most confidence?

#NestJS #Testing #SoftwareQuality

## Community discussion

Top comments from developers on daily.dev.

**@navyaak** · 1 upvotes

> Developer testing

**@agustinbarrientos** · 0 upvotes

> At service boundaries, I'd keep contract tests. They catch integration drift without paying the startup cost of a full end-to-end suite.

## Similar posts on daily.dev

- [Module Test](https://daily.dev/posts/module-test-7cztbz9zp) · The Daily WTF · 1 upvotes · 1 comments
- [An advanced guide to Nuxt testing and mocking](https://daily.dev/posts/an-advanced-guide-to-nuxt-testing-and-mocking-qzstakmm0) · LogRocket · 1 upvotes · 0 comments
- [How Cloud-Native Complexity is Outpacing Test Automation Strategy](https://daily.dev/posts/how-cloud-native-complexity-is-outpacing-test-automation-strategy-aizwf7ic6) · Cloud Native Now · 0 upvotes · 0 comments
- [TDD is a Luxury: Pragmatic Testing for the Solo Developer](https://daily.dev/posts/tdd-is-a-luxury-pragmatic-testing-for-the-solo-developer-tawfchoo4) · Ruby Flow · 0 upvotes · 1 comments
- [Stop Writing Database-Dependent Tests — Mock Your Data Access Layer](https://daily.dev/posts/stop-writing-database-dependent-tests-mock-your-data-access-layer-quo7rycbz) · Javarevisited · 98 upvotes · 10 comments

---

Tags: [#testing](https://daily.dev/tags/testing), [#typescript](https://daily.dev/tags/typescript), [#nestjs](https://daily.dev/tags/nestjs)

[View this post on daily.dev](https://daily.dev/posts/day-22-30-test-behaviour-d5kdwtggz)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/day-22-30-test-behaviour-d5kdwtggz","headline":"Day 22/30 — Test Behaviour","text":"A short testing philosophy piece for NestJS applications, arguing that tests should validate application behavior rather than implementation details like decorators. It outlines a practical layering strategy: unit tests for business logic, integration tests for infrastructure boundaries, and end-to-end tests for critical user journeys, with a call to pick the smallest test that catches the failure you care about.","url":"https://daily.dev/posts/day-22-30-test-behaviour-d5kdwtggz","datePublished":"2026-08-24T07:15:22.894Z","dateModified":"2026-09-13T20:58:46.783Z","author":{"@type":"Person","name":"Ezile Mdodana","url":"https://daily.dev/ezilemdodana","image":"https://media.daily.dev/image/upload/s--1OI8gwnO--/f_auto/v1771923757/avatars/avatar_7vB9SeLRKhOHGnzEpmFvQ?_a=BAMAMiiu0","description":"Software Project Lead sharing practical insights on NestJS, Angular, AWS and scalable systems.","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":8430}},"image":"https://media.daily.dev/image/upload/s--V1yi6zZ6--/f_auto/v1787555724/posts/D5kdwtGGz?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":12},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"comment":[{"@type":"Comment","text":"Developer testing","datePublished":"2026-08-25T16:43:04.213Z","url":"https://daily.dev/posts/D5kdwtGGz#c-ESv3K3Rqk","author":{"@type":"Person","name":"navya","url":"https://daily.dev/navyaak","image":"https://media.daily.dev/image/upload/s--vM6dTj_h--/f_auto/v1788852968/avatars/avatar_DLRmpRw88MjNBUKqs8T0W?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"At service boundaries, I’d keep contract tests. They catch integration drift without paying the startup cost of a full end-to-end suite.","datePublished":"2026-08-30T15:06:08.945Z","url":"https://daily.dev/posts/D5kdwtGGz#c-Fx5i68NPZ","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/nestjsdevs","name":"Nestjs Developers"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Nestjs Developers","item":"https://daily.dev/squads/nestjsdevs"},{"@type":"ListItem","position":3,"name":"Day 22/30 — Test Behaviour"}]}
```

