jest/snapshot

Snapshot Testing

Test component snapshots

jest
snapshot
components

Command

expect(component).toMatchSnapshot()

Explanation

Snapshot testing captures the output of components and compares it to stored snapshots.

Examples

Create snapshot

expect(component).toMatchSnapshot()

Inline snapshot

expect(tree).toMatchInlineSnapshot()