Skip to main content
Bun’s test runner supports Jest-style snapshot testing with .toMatchSnapshot().
snap.test.ts

The first time this test runs, Bun writes a snapshot file to a __snapshots__ directory alongside the test file.
File Tree

To regenerate snapshots, use the --update-snapshots flag.
terminal

See Snapshots.