verify-email-snapshots

Snapshot test rendered email HTML templates using the Verify .NET testing library.

Updated Mar 8, 2026
One-click install
npx skills add https://github.com/AGIBuild/dotnet.CI.template --skill verify-email-snapshots-agibuild
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: verify-email-snapshots
Source: https://github.com/AGIBuild/dotnet.CI.template/tree/main/.cursor/skills/verify-email-snapshots
Command: npx skills add https://github.com/AGIBuild/dotnet.CI.template --skill verify-email-snapshots-agibuild

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Email templates produce complex HTML that is hard to assert with traditional unit tests, and small template changes can silently break rendering across email clients. This Skill provides patterns for snapshot testing email output so regressions surface as reviewable diffs instead of production bugs. ## Core Features & Use Cases - Snapshot Testing with Verify: Capture rendered email HTML as .verified.html baselines and fail tests when output changes unexpectedly. - Dynamic Value Scrubbing: Normalize timestamps, GUIDs, and tokens so snapshots remain stable across test runs. - Composer-Level Tests: Verify full email objects including subject, recipients, and HTML body, plus CI integration that fails on missing baselines. - Use Case: When refactoring an MJML welcome email template, run the snapshot tests to get a visual diff of the rendered HTML, review it in a browser or diff tool, and accept the change only after confirming the rendering is correct. ## Quick Start Write a snapshot test for my email template rendering using Verify.Xunit and show me how to scrub dynamic values like dates and GUIDs.

Frequently Asked Questions about verify-email-snapshots

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

FAQPage Schema
How do I snapshot test email templates in .NET?▼

Use the Verify library with xUnit, NUnit, or MSTest to capture rendered email HTML as a verified baseline file. Render the template with sample variables, pass the HTML to Verify with the html extension, and the test fails with a diff whenever output changes.

How to test MJML email template rendering in unit tests?▼

Render the MJML template through your IMjmlTemplateRenderer with a dictionary of test variables, then snapshot the resulting HTML with Verify. Create one test per template variant so regressions in any single email are isolated and easy to review.

Why do email snapshot tests fail between runs?▼

Failures usually come from dynamic values like timestamps, GUIDs, or tokens embedded in the HTML. Scrub them with ScrubLinesContaining, ScrubInlineGuids, or custom regex scrubbers so only meaningful content changes trigger diffs.

Does Verify work with NUnit and MSTest or only xUnit?▼

Verify supports xUnit, NUnit, and MSTest through dedicated packages such as Verify.Xunit, Verify.NUnit, and Verify.MSTest. The snapshot and scrubbing APIs work the same way across all supported test frameworks.

How do I prevent accidental snapshot acceptance in CI?▼

Call VerifierSettings.ThrowOnMissingVerifiedFile in test setup so CI fails when no verified baseline exists. Review diffs locally with the verify tool or a diff viewer and commit updated verified files only after manual inspection.