A flexible snapshot testing tool for .NET Core and .NET Framework, inspired by Jest Snapshot Testing.
Snapshooter is a snapshot testing tool for .NET Core and .NET Framework that simplifies unit test validation. It captures snapshots of test result objects and compares them against stored references, reducing manual assertion code and ensuring consistency across test runs. Inspired by Jest Snapshot Testing, it integrates seamlessly with popular .NET testing frameworks like Xunit, NUnit, and MSTest.
.NET developers writing unit tests who want to reduce boilerplate assertion code and ensure consistent test results, particularly those working with complex object structures or integrating snapshot testing into CI/CD pipelines.
Developers choose Snapshooter for its flexibility in ignoring, hashing, and asserting specific fields using JsonPath, multiple syntax options for different testing frameworks, and strict mode support for CI environments, making it a robust alternative to manual object comparisons.
Snapshooter is a snapshot testing tool for .NET Core and .NET Framework
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses JsonPath syntax to ignore or hash specific fields, enabling precise snapshot validation without boilerplate code, as shown in examples like ignoring 'Address.StreetNumber' or hashing 'Data' fields.
Supports strict mode via environment variables to fail tests without existing snapshots in CI builds, ensuring snapshots are checked in and preventing false passes.
Offers fluent, MatchSnapshot(), and Should().MatchSnapshot() syntaxes for seamless integration with Xunit, NUnit, and MSTest, reducing adoption friction.
Hashes binary or large fields for efficient comparison, reducing snapshot size and performance overhead, demonstrated with image data examples in the README.
Requires managing __snapshots__ folders and manually moving mismatch files from __mismatch__, adding maintenance overhead and potential for human error.
Advanced features like ignoring or asserting fields rely on JsonPath syntax, which may be unfamiliar to some .NET developers and increase initial setup complexity.
Promised syntaxes like NUnit's Assert.That are listed as 'Coming soon', indicating gaps in full framework integration and potential delays for users.