https://github.com/verifytests/verify.quibble
Extends Verify to allow comparison of text via Quibble.
https://github.com/verifytests/verify.quibble
quibble snapshot-testing verify-tests
Last synced: about 1 year ago
JSON representation
Extends Verify to allow comparison of text via Quibble.
- Host: GitHub
- URL: https://github.com/verifytests/verify.quibble
- Owner: VerifyTests
- License: mit
- Created: 2021-08-24T06:15:13.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T11:24:40.000Z (about 1 year ago)
- Last Synced: 2025-04-14T12:29:59.080Z (about 1 year ago)
- Topics: quibble, snapshot-testing, verify-tests
- Language: C#
- Homepage:
- Size: 419 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: license.txt
- Code of conduct: code_of_conduct.md
Awesome Lists containing this project
README
#
Verify.Quibble
[](https://github.com/orgs/VerifyTests/discussions)
[](https://ci.appveyor.com/project/SimonCropp/Verify-Quibble)
[](https://www.nuget.org/packages/Verify.Quibble/)
Extends [Verify](https://github.com/VerifyTests/Verify) to allow [comparison](https://github.com/VerifyTests/Verify/blob/master/docs/comparer.md) of text via [Quibble](https://github.com/nrkno/Quibble).
**See [Milestones](../../milestones?state=closed) for release notes.**
## NuGet package
https://nuget.org/packages/Verify.Quibble/
## Usage
### Initialize
```cs
[ModuleInitializer]
public static void Init()
{
VerifierSettings.UseStrictJson();
VerifyQuibble.Initialize();
}
```
snippet source | anchor
`UseStrictJson` is required since Verify by default [uses a variant of json](https://github.com/VerifyTests/Verify/blob/main/docs/serializer-settings.md#not-valid-json) which Quibble cannot parse.
### Verify
Given an existing verified file:
```json
{
"Property1": "ValueA",
"Property2": "ValueB"
}
```
And a test:
```cs
[Test]
public async Task Sample()
{
var target = new Target(
Property1: "ValueC",
Property2: "ValueD");
await Verifier.Verify(target);
}
```
### Diff results
When the comparison fails, the resulting differences will be included in the test result displayed to the user.
```txt
Results do not match.
Use DiffEngineTray to verify files.
Differences:
Received: Tests.Sample.received.json
Verified: Tests.Sample.verified.json
Compare Result:
String value difference at $.Property1: ValueC vs ValueA.
String value difference at $.Property2: ValueD vs ValueB.
```
## Icon
[Argument](https://thenounproject.com/term/argument/2311124/) designed by [Vinence Studio](https://thenounproject.com/vinzencestudio/) from [The Noun Project](https://thenounproject.com).