Latest Posts

Testing a Simple Nuxt Feature 🞄 9 Bonus: Add Integration Tests

A minimal integration test to verify the behavior of a composable using localStorage in a Nuxt app.

2 min read

Testing a Simple Nuxt Feature 🞄 8 Move Dependencies to a Repository

Version 6 of our banner takes a bigger step toward clean architecture. We define a repository interface, inject it into our composable, and provide two implementations: one for the browser and one for unit tests. This approach helps decouple the logic from I/O and keeps our tests fast and focused. We also reflect on what's next: using app.config, wrapping version in an entity, and writing integration tests.

9 min read

Testing a Simple Nuxt Feature 🞄 7 Unit Testing the Composable

Version 5 of our banner continues the exploration of testable composables. By removing `onMounted`, mocking `useRuntimeConfig`, and even `localStorage`, we move closer to unit tests that are truly isolated. But at what cost? We reflect on the complexity this introduces and whether dependency injection might offer a cleaner solution.

8 min read

Testing a Simple Nuxt Feature 🞄 6 Test the composable

Version 4 of our banner introduces a tricky scenario: testing a composable that uses `onMounted`. We explore various testing strategies—including using `withSetup`, wrapper components, and the decision to move lifecycle logic outside the composable—to understand when and how to simplify our tests.

8 min read

Testing a Simple Nuxt Feature 🞄 5 Avoid Mocks With the 'Component Wrapper' Pattern

Version 3 of our banner implements the 'Component Wrapper' Pattern, allowing us to avoid mocks.

5 min read

Testing a Simple Nuxt Feature 🞄 4 Mocking the composable

Fourth episode: Mocking the composable will help us isolate the component test without relying on Nuxt's real interactions or localStorage behavior.

8 min read
See more posts

Latest Works

See more works