snapshot-diff
snapshot-diff copied to clipboard
Support for inline snapshots
Would be nice to have inline snapshots for this library.
@mattalexx (As a "workaround") You can do inline snapshots with the snapshotDiff
and toMatchInlineSnapshot
function.
For example, the following would generate an inline snapshot:
test('snapshot difference between 2 React components state', () => {
expect(
snapshotDiff(<Component test="say" />, <Component test="my name" />)
).toMatchInlineSnapshot();
});
I think it makes sense to provide a custom matcher though, since it's a cleaner API. This does not seem too hard -- I can submit a pull request for it. Hopefully this project is still being maintained and someone can release a new version though? cc: @thymikee