Testing Blocks

Run unit, browser, lint, and performance tests for AEM Edge Delivery projects.

3|Updated Apr 17, 2025
One-click install
npx skills add https://github.com/arbory-digital-inc/sas-demo --skill testing-blocks-arbory-digital-inc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Testing Blocks
Source: https://github.com/arbory-digital-inc/sas-demo/tree/main/.claude/skills/testing-blocks
Command: npx skills add https://github.com/arbory-digital-inc/sas-demo --skill testing-blocks-arbory-digital-inc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides a structured testing workflow for AEM Edge Delivery projects, guiding you through unit tests, browser tests, linting, and performance checks to validate changes before PRs.

Core Features & Use Cases

  • Unit testing with Vitest for logic-heavy utilities and data processing used across blocks.
  • Browser testing with Playwright for throwaway UI validations, cross-viewport checks, and interaction tests.
  • Linting and performance validation integrated into the development workflow to ensure quality before PRs.

Quick Start

  1. Install Vitest and Playwright, then set up basic test scaffolding.
  2. Run tests in watch mode during development with npm run test:watch.
  3. Manually validate changes in the local dev server and capture screenshots as needed.

Frequently Asked Questions about Testing Blocks

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

FAQPage Schema
How do I validate code changes with unit tests before a PR?

You validate code changes before a PR by running unit tests with Vitest and jsdom to verify logic-heavy utilities. This workflow ensures standardized testing across blocks and utilities to maintain project quality before submitting changes.

What's the best way to run browser tests for UI validations across viewports?

The best way to run browser tests for UI validations is using Playwright to perform cross-viewport checks and interaction tests. This approach allows you to verify throwaway UI validations and capture screenshots of the local dev server.

Does this testing workflow support AEM Edge Delivery projects?

Yes, this testing workflow directly supports AEM Edge Delivery projects. It provides a standardized structure and tooling for unit tests, browser tests, linting, and performance checks specifically across blocks and utilities.

How do I set up test scaffolding for Vitest and Playwright?

You set up test scaffolding by installing Vitest and Playwright, then creating basic test configurations. Once installed, you can run tests in watch mode during development using npm run test:watch to continuously validate changes.

Why should I include linting and performance checks in my testing workflow?

You include linting and performance checks in your testing workflow to enforce quality standards before PRs. Integrating these checks into the development process ensures code changes are fully validated across functionality and performance metrics.

Can I use Vitest for testing data processing utilities used across blocks?

Yes, you can use Vitest for testing data processing utilities used across blocks. It is specifically applied to verify logic-heavy utilities, ensuring that data transformations and processing functions maintain expected behavior.