Files
2026-04-17 23:26:01 +00:00

1.8 KiB

name, description, metadata
name description metadata
nuxt-testing Nuxt testing with @nuxt/test-utils — unit tests with Nuxt runtime environment, component testing with mountSuspended, mocking auto-imports, and e2e testing with Playwright. Use when writing tests for Nuxt apps, components, composables, or pages.
author version source
Phil 2026.4.10 Generated from https://nuxt.com/docs/4.x/getting-started/testing

Testing Nuxt applications using @nuxt/test-utils with Vitest. Covers unit testing in a Nuxt runtime environment, component testing with mountSuspended, mocking Nuxt auto-imports and components, and end-to-end testing with Playwright.

Based on Nuxt 4.x / @nuxt/test-utils documentation, generated at 2026-04-10.

Setup

Topic Description Reference
Installation & Config Dependencies, vitest.config.ts with projects, test directory structure setup-config

Unit Testing

Topic Description Reference
Nuxt Environment Running tests in the Nuxt runtime environment, environment options, organizing test directories unit-nuxt-environment
Helpers mountSuspended, renderSuspended, mockNuxtImport, mockComponent, registerEndpoint unit-helpers
Built-In Mocks IntersectionObserver and IndexedDB mocks in the Nuxt test environment unit-mocks

End-to-End Testing

Topic Description Reference
E2E with Vitest Setup function, $fetch, fetch, url helpers, browser testing with createPage e2e-vitest
E2E with Playwright Playwright test runner integration, goto helper, configuration e2e-playwright