selfie-snapshot-testing

Automate Selfie snapshot test creation and updates in JVM projects.

Updated Jun 11, 2019
One-click install
npx skills add https://github.com/Sanmoo/dotfiles --skill selfie-snapshot-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: selfie-snapshot-testing
Source: https://github.com/Sanmoo/dotfiles/tree/main/opencode/.config/opencode/skills/selfie-snapshot-testing
Command: npx skills add https://github.com/Sanmoo/dotfiles --skill selfie-snapshot-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill streamlines the creation and maintenance of snapshot tests for JVM projects using Selfie, reducing manual overhead and ensuring reliable test updates.

Core Features & Use Cases

  • Snapshot Automation: Generate and update snapshot files automatically during test runs.
  • Source Code Rewriting: Rewrite test assertions from _TODO to final form post-execution.
  • Use Case: When working on a Kotlin backend, developers can write placeholder snapshot assertions and effortlessly update them with real data after tests pass.

Quick Start

Write test assertions using Selfie’s _TODO variants and run your tests to automatically generate and insert snapshots.

Frequently Asked Questions about selfie-snapshot-testing

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

FAQPage Schema
How do I automate JVM snapshot tests for Java and Kotlin?

You can automate JVM snapshot tests by writing placeholder assertions using Selfie's `_TODO` variants and running your tests to automatically generate and insert real snapshot data. This reduces manual overhead during development.

What is the best way to update Selfie snapshot files in a JUnit 5 project?

The best way to update Selfie snapshot files is to run your tests with this automation, which rewrites test assertions from `_TODO` placeholders to their final form and manages inline or disk snapshots seamlessly.

Does Selfie snapshot automation work with Kotlin backend codebases?

Yes, Selfie snapshot automation works with Kotlin backend codebases. Developers can write placeholder snapshot assertions and effortlessly update them with real data after tests pass.

How does source code rewriting work for Selfie snapshot tests?

Source code rewriting works by automatically replacing `_TODO` test assertion variants with final snapshot data post-execution. This ensures snapshots are generated and maintained seamlessly without manual intervention.

Do I need JUnit 5 to maintain inline snapshot tests with Selfie?

Yes, you need JUnit 5 to utilize this Selfie automation for inline or disk snapshot management. It is specifically applicable for Java and Kotlin codebases that use JUnit 5 during development.

Why should I use Selfie for snapshot testing instead of manual assertions?

You should use Selfie to enhance test reliability and reduce manual effort. It streamlines the creation and maintenance of snapshot tests, ensuring snapshots are generated, rewritten, and maintained seamlessly.