Skip to content

snapshotDiff between two single line strings output null #22

Closed
@allotrop3

Description

@allotrop3

Code:

expect(snapshotDiff("foo", "bar")).toMatchSnapshot();

Result:

Received value
    Snapshot Diff:
    null

It seems adding a new line to the end of both arguments results in a valid snapshot diff.

Code

expect(snapshotDiff("foo" + "\n", "bar" + "\n")).toMatchSnapshot();

Result

Received value
    Snapshot Diff:
    - First value
    + Second value

    - foo
    + bar

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