Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
31 lines (21 sloc) 682 Bytes

Suggest using inline snapshots (prefer-inline-snapshots)

In order to make snapshot tests more managable and reviewable toMatchInlineSnapshot() and toThrowErrorMatchingInlineSnapshot should be used to write the snapshots inline in the test file.

Rule details

This rule triggers a warning if toMatchSnapshot() or toThrowErrorMatchingSnapshot is used to capture a snapshot.

The following pattern is considered warning:

expect(obj).toMatchSnapshot();
expect(error).toThrowErrorMatchingSnapshot();

The following pattern is not warning:

expect(obj).toMatchInlineSnapshot();
expect(error).toThrowErrorMatchingInlineSnapshot();
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.