- Home
- Skills
- Aaronontheweb
- Dotnet Skills
- Snapshot Testing
snapshot-testing_skill
- Shell
643
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill aaronontheweb/dotnet-skills --skill snapshot-testing- SKILL.md9.0 KB
Overview
This skill integrates Verify-based snapshot testing into .NET projects to approve and track expected outputs. It helps teams detect unintended changes by comparing runtime output against human-approved baseline files. Use it for rendered HTML/emails, public API surfaces, HTTP responses, and serialized objects.
How this skill works
On first run a test produces a .received file containing the actual output. A developer reviews and approves that output, creating a .verified baseline file. Subsequent test runs compare current output to the .verified file and fail when differences are detected, showing a diff for human review. Dynamic values can be scrubbed or replaced so only meaningful changes surface.
When to use it
- Validate rendered HTML or email templates to catch layout and content regressions
- Approve public API surfaces to prevent accidental breaking changes
- Verify HTTP responses including status, headers, and body together
- Confirm serialization and wire-format outputs remain stable
- Test complex object graphs where many assertions would be cumbersome
Best practices
- Use descriptive test names — they become snapshot file names and simplify review
- Scrub timestamps, GUIDs, tokens, and other dynamic values consistently
- Keep .verified files in source control and ignore .received files
- Use file extensions for non-text content (e.g., extension: "html") so snapshots open in appropriate viewers
- Configure ModuleInitializer for project-relative snapshot directories and CI-safe diff behavior
Example use cases
- Render and verify welcome or transactional emails to detect CSS/layout regressions
- Generate and approve a public API surface listing to catch breaking changes before release
- Verify HTTP endpoint responses in integration tests including selected headers
- Snapshot serialized DTOs or generated code to detect accidental formatting or structural changes
- Approve complex report or document output where visual review is required
FAQ
Commit .verified files so the approved baseline is versioned. Ignore .received files; they are transient and used only for review.
How do I handle GUIDs and timestamps that change every run?
Use Verify's scrubbing APIs or configure global scrubbers in ModuleInitializer to replace dynamic values with stable placeholders before comparison.