approval-tests

Automate approval-based testing by generating and validating expected outputs against runtime results.

225|62|Updated Dec 29, 2025
One-click install
npx skills add https://github.com/lexler/skill-factory --skill approval-tests
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: approval-tests
Source: https://github.com/lexler/skill-factory/tree/main/output_skills/testing/approval-tests
Command: npx skills add https://github.com/lexler/skill-factory --skill approval-tests

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Approval testing provides a robust alternative to many small assertions by capturing a known-good output and comparing future runs against it, reducing flaky tests and maintenance overhead.

Core Features & Use Cases

  • Cross-language verification: supports Python, Java, and JavaScript/TypeScript environments to verify complex outputs.
  • Snapshot/Golden-master style testing: validates large outputs with a single approval, including combinations and logs.
  • On-demand references and patterns: leverages optional scripts, references, and assets to organize testing patterns and reuse test data.

Quick Start

Install the language package for approvals (e.g., pip install approvaltests, npm install approvals), write a test that calls verify or verifyAsJson, run the tests to generate .received/.approved files, review the received output, and rename it to approved to finalize the baseline.

Frequently Asked Questions about approval-tests

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

FAQPage Schema
What is approval testing and how does it differ from writing assertions?

Approval testing captures a known-good output as a baseline and compares future runs against it, replacing many small assertions with a single snapshot diff to reduce flaky tests and maintenance overhead.

How do I start with snapshot testing across Python, Java, and Node.js projects?

Install the language package, write a test calling verify or verifyAsJson, run it to generate .received/.approved files, review the output, and rename the received file to approved to finalize the baseline.

Can I use golden-master testing to verify complex log outputs and combinations?

Yes, golden-master testing validates large outputs, combinations, and log outputs with a single approval, supporting flexible naming and reporting across Python, Java, and JavaScript/TypeScript environments.

Does approval testing support data scrubbing and inline approvals for dynamic content?

Approval testing supports data scrubbing to handle dynamic content and optional inline approvals, allowing you to manage expected outputs directly within the test code instead of separate files.

What is the .approved and .received file workflow in approval testing?

The workflow generates a .received file containing runtime output, compares it against the existing .approved baseline, and uses reporters to highlight diffs so you can review and update the approved reference.

When should I choose snapshot testing over traditional assertion-based tests?

Choose snapshot testing when verifying complex, large, or combination outputs where maintaining many individual assertions becomes brittle, leveraging a known-good baseline to streamline cross-language verification.