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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The linked PR is about to add .toMatchNamedSnapshot() matcher to Jest. The matcher works similar to .toMatchSnapshot(), but requires setting snapshot name explicitly that allows snapshot testing in concurrent mode (details of the problem jestjs/jest#2180).
After the PR lands, eslint-plugin-jest could be helpful by adding these rules:
no-duplicate-snapshot-names: show error if the same snapshot name was used twice in a test file
prefer-named-snapshots: require to use .toMatchNamedSnapshot() matcher with test.concurrent (or always)
This is just a note for discussion. No action required at the moment (;
The text was updated successfully, but these errors were encountered:
Yeah they sound reasonable (though I'd probably say go with prefer-snapshot-name to match nicely with prefer-snapshot-hint) - you could do prefer-snapshot-name with no-restricted-matchers, though that would be all or nothing and I guess it makes sense for us to tell people by default what to do when using concurrent
From jestjs/jest#14045 (comment)
The linked PR is about to add
.toMatchNamedSnapshot()
matcher to Jest. The matcher works similar to.toMatchSnapshot()
, but requires setting snapshot name explicitly that allows snapshot testing inconcurrent
mode (details of the problem jestjs/jest#2180).After the PR lands,
eslint-plugin-jest
could be helpful by adding these rules:no-duplicate-snapshot-names
: show error if the same snapshot name was used twice in a test fileprefer-named-snapshots
: require to use.toMatchNamedSnapshot()
matcher withtest.concurrent
(or always)This is just a note for discussion. No action required at the moment (;
The text was updated successfully, but these errors were encountered: