Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove unnecessary boilerplate from snapshots #36

Open
Labels
@dantman

Description

I'm using snapshot-diff with the custom serializer:

 "jest": {
 "snapshotSerializers": [
 "snapshot-diff/serializer.js"
 ]
}
expect(initialTemplate).toMatchDiffSnapshot(result, {contextLines: 3});

And I'm getting snapshot output like this:

exports[`Template actions setPageTitle should set the meta.title belonging to the page 1`] = `
Snapshot Diff:
- First value
+ Second value

@@ -16,7 +16,7 @@
 "pages": Object {
 "test-01": Object {
 "meta": Object {
- "title": "Untitled",
+ "title": "Page 1",
 },
 },
 ...
`;

It's a little annoying because these lines are redundant, the test isn't going to cease to be a snapshot diff and I don't need information about how diffs work embedded inside every single snapshot.

Snapshot Diff:
- First value
+ Second value

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /