crablet-test-authoring

Automate creation and execution of unit, integration, and scenario tests for Crablet applications.

1|1|Updated Oct 17, 2025
One-click install
npx skills add https://github.com/rodolfodpk/spring-crablet --skill crablet-test-authoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: crablet-test-authoring
Source: https://github.com/rodolfodpk/spring-crablet/tree/main/.claude/skills/crablet-test-authoring
Command: npx skills add https://github.com/rodolfodpk/spring-crablet --skill crablet-test-authoring

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires crablet, testcontainers, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of writing and managing tests for Crablet applications, helping developers ensure the robustness and reliability of their event-sourced applications.

Core Features & Use Cases

  • Command Handler Unit Tests: Write unit tests for command handlers using BDD-style given/when/then helpers.
  • Integration Tests: Set up and run integration tests against a real PostgreSQL database using Testcontainers.
  • Scenario Tests: Generate and maintain scenario tests for event-model scenarios.
  • Audit Linkage: Ensure command-to-event audit linkage in tests.
  • Test Layer Guidance: Provides guidance on selecting the appropriate test layer for different behaviors (unit, integration, scenario).

Quick Start

To write a test for a command handler, use the crablet-test-authoring skill and specify the handler or behavior to test.

Frequently Asked Questions about crablet-test-authoring

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

FAQPage Schema
How do I write integration tests for event sourcing applications?

Integration testing for event sourcing applications is automated by setting up a real PostgreSQL database using Testcontainers to validate command handlers and event scenarios against live data.

What is the best way to structure BDD-style tests for command handlers?

BDD-style tests for command handlers use given/when/then helpers to define initial event states, trigger commands, and assert resulting events, ensuring clear audit linkage between commands and outcomes.

Do I need Testcontainers to run database integration tests?

Yes, Testcontainers is required for database integration tests, providing isolated, real PostgreSQL instances to accurately validate event-sourced behaviors and command-to-event audit linkage during execution.

How do I test event-model scenarios in an event-sourced system?

Event-model scenario testing is automated by generating and maintaining test cases that validate sequences of domain events, ensuring aggregate state transitions and audit linkages behave as expected.

When should I choose scenario tests over unit tests for command handlers?

Unit tests validate individual command handler logic using BDD helpers, while scenario tests validate broader event-model sequences; choose unit tests for isolated behavior and scenario tests for multi-event aggregate flows.

Why include command-to-event audit linkage in my testing workflow?

Command-to-event audit linkage is included in testing to verify that every command produces the expected, traceable domain events, ensuring data integrity and reliable event-sourced state reconstruction.