umbraco-msw-testing

Mock Umbraco backoffice extension APIs with MSW v2 during testing.

Updated Mar 6, 2026
One-click install
npx skills add https://github.com/kraftvaerk/Kraftvaerk.Umbraco.Alchemy --skill umbraco-msw-testing-kraftvaerk
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: umbraco-msw-testing
Source: https://github.com/kraftvaerk/Kraftvaerk.Umbraco.Alchemy/tree/main/Kraftvaerk.Umbraco.Alchemy.Frontend/.agents/skills/umbraco-msw-testing
Command: npx skills add https://github.com/kraftvaerk/Kraftvaerk.Umbraco.Alchemy --skill umbraco-msw-testing-kraftvaerk

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill enables reliable testing of Umbraco backoffice extensions by intercepting and mocking API requests, allowing for isolated testing of various scenarios without a live Umbraco instance.

Core Features & Use Cases

  • API Mocking: Intercepts network requests to simulate API responses.
  • Error State Testing: Easily test how your extension handles 404s, 500s, and validation errors.
  • Loading State Testing: Verify UI behavior during network delays or loading spinners.
  • Use Case: Test the complete error handling flow of a custom content editor by mocking a 500 server error response from the API endpoint that saves the content.

Quick Start

Use the umbraco-msw-testing skill to set up mock API handlers for your Umbraco backoffice extension tests.

Frequently Asked Questions about umbraco-msw-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I mock Umbraco backoffice APIs for frontend testing?

Test Umbraco extension error states by using MSW to intercept HTTP requests and return predefined 404, 500, or validation error responses, verifying your UI handles these failures correctly.

Can I test loading states and network retries using MSW with Umbraco?

Yes, you can test loading states and network retry behavior using MSW to intercept API requests and simulate network delays, verifying UI behavior during loading spinners and retries.

Do I need a live Umbraco instance to test my backoffice extension?

No, you do not need a live Umbraco instance. MSW intercepts network requests to simulate API responses, enabling reliable isolated testing of your extension's various scenarios.

What test runners and MSW versions are compatible with Umbraco API mocking?

This setup requires MSW v2 and integration with a test runner like Web Test Runner to mock Umbraco backoffice extension APIs during testing.

What is the best way to test API error handling in Umbraco content editors?

The best way to test API error handling is using MSW to mock the endpoint that saves content, returning a 500 server error to test the complete error handling flow of your custom content editor.