approval-tests

Automate snapshot and golden master testing for Python, JavaScript/TypeScript, or Java codebases.

1|Updated May 14, 2025
One-click install
npx skills add https://github.com/fcnatra/VibeCoding --skill approval-tests-fcnatra
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: approval-tests
Source: https://github.com/fcnatra/VibeCoding/tree/main/Copilot%20Tools/skills/testing/approval-tests
Command: npx skills add https://github.com/fcnatra/VibeCoding --skill approval-tests-fcnatra

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the creation and maintenance of complex tests by comparing output against pre-approved "golden master" files, significantly reducing the effort required for writing and updating assertions.

Core Features & Use Cases

  • Snapshot Testing: Captures complex output once, approves it, and automatically compares future runs against the approved version.
  • Characterization Testing: Quickly snapshot the behavior of legacy code before refactoring.
  • Combinatorial Testing: Test all input combinations exhaustively without writing individual tests for each case.
  • Use Case: When testing a function that generates a detailed HTML report, instead of writing dozens of assertions for specific elements, you can use Approval Tests to capture the entire HTML output, review it, approve it, and then ensure any future changes to the report generation logic are immediately flagged.

Quick Start

Use the approval-tests skill to verify the output of the generate_report function.

Frequently Asked Questions about approval-tests

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

FAQPage Schema
How do I write snapshot tests for complex Python or JavaScript output?

Snapshot tests for complex output are automated by capturing the initial result as a golden master file, then automatically comparing future runs against this pre-approved version to flag any changes.

What is the best way to characterize legacy code before refactoring?

Characterization testing for legacy code is done by taking a snapshot of its current behavior using golden master files, allowing you to verify that existing outputs remain unchanged during refactoring.

Can I test all input combinations exhaustively without writing individual tests?

Combinatorial testing allows you to test all input combinations exhaustively by automatically generating and verifying outputs against approved golden master files without writing individual test cases.

Do I need specific testing frameworks to use approval tests?

Yes, executing approval tests requires specific language SDKs and testing frameworks for Python, JavaScript/TypeScript, or Java codebases to manage the .approved and .received files.

How do I manage .approved and .received files during regression testing?

Regression testing manages .approved and .received files by automatically generating the received output, comparing it to the approved golden master, and prompting you to review and approve any differences.