umbraco-unit-testing

Test Umbraco backoffice extensions with @open-wc/testing and Web Test Runner.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a robust framework and clear guidance for writing unit and component tests for Umbraco backoffice extensions, ensuring code quality and maintainability.

Core Features & Use Cases

  • Isolated Testing: Write fast, isolated tests for Lit elements, controllers, and utility functions.
  • Context Testing: Test how components interact with Umbraco's context system.
  • Mocking Strategies: Offers both full Umbraco imports and simplified mock-based approaches for different testing needs.
  • Use Case: You've developed a new custom property editor for Umbraco. Use this Skill to write tests that verify its rendering, state management, and interactions with Umbraco services before deployment.

Quick Start

Configure your project by adding the specified dependencies to package.json and setting up the web-test-runner.config.mjs file.

Frequently Asked Questions about umbraco-unit-testing

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

FAQPage Schema
How do I write unit tests for Umbraco backoffice extensions?

Unit testing Umbraco backoffice extensions is done using @open-wc/testing and Web Test Runner. This Skill guides you through testing Lit elements, controllers, and observable patterns with either full context imports or isolated mocks.

Can I test Lit elements and controllers without a full Umbraco context?

Yes, you can test Lit elements and controllers in isolation using simplified mocking strategies. This approach allows you to write fast tests by avoiding full Umbraco context imports when they are unnecessary.

What dependencies do I need for component testing Umbraco extensions?

Component testing Umbraco extensions requires a Node.js environment with npm or yarn for dependency management. You must install @open-wc/testing and configure Web Test Runner to execute the tests.

How do I set up Web Test Runner for Umbraco Lit elements?

To set up Web Test Runner for Umbraco Lit elements, you add the specified testing dependencies to your package.json and create a web-test-runner.config.mjs file in your project to configure execution.

What is the best way to verify a custom Umbraco property editor before deployment?

The best way to verify a custom property editor is by writing component tests that check its rendering, state management, and interactions with Umbraco services using @open-wc/testing.

Does this testing approach support both context integration and mock-based isolation?

Yes, this testing approach supports both full Umbraco context integration and mock-based isolation strategies. You can choose to import the complete context or use mocks for faster, isolated tests.