block-testing

Establishes standardized Jest testing patterns for EDS blocks with mock support.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/aramark-destinations/aramark-mb --skill block-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: block-testing
Source: https://github.com/aramark-destinations/aramark-mb/tree/main/.agents/skills/eds/block-testing
Command: npx skills add https://github.com/aramark-destinations/aramark-mb --skill block-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Testing guidance for EDS blocks to bootstrap reliable unit tests, including keeper vs throwaway tests and mocks for common utilities.

Core Features & Use Cases

  • Bootstrap Test Infrastructure with Jest and Babel config
  • Keeper vs Throwaway tests guidance and practical patterns
  • Mock patterns for aem.js, scripts.js, and analytics
  • Co-located tests in blocks/{name} for maintainable structure

Quick Start

Run the Jest test suite for this block by executing pnpm test in the project root.

Frequently Asked Questions about block-testing

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

FAQPage Schema
How do I set up Jest unit tests for EDS blocks with event handling and state management?

To set up Jest unit tests for EDS blocks, you bootstrap test infrastructure with Jest and Babel config, then co-locate tests under blocks/{name} to maintain robust suites for complex logic.

What is the difference between keeper and throwaway tests in Jest?

Keeper tests are maintained long-term to verify robust block logic, while throwaway tests validate temporary data transformation or state changes before being discarded, ensuring a maintainable test suite.

How do I mock aem.js and analytics utilities in Jest?

You mock aem.js and analytics utilities by applying standardized mock patterns provided for common scripts, isolating block logic during Jest test automation without triggering actual external dependencies.

Does this Jest testing pattern work for blocks with complex data transformation?

Yes, the Jest testing pattern specifically applies to EDS blocks with event handling, data transformation, and complex state management, providing bootstrapped infrastructure to verify logic accurately.

What's the best way to organize Jest test files for EDS blocks?

The best way to organize Jest test files is co-locating them within the blocks/{name} directory structure, which keeps tests maintainable and closely aligned with the specific block's logic.