Snapshots
Snapshot assertions compare the current value to a stored snapshot.
Example:
ts
import { test, expect } from "as-test";
test("serializes payload", () => {
expect("hello").toMatchSnapshot("greeting");
});Useful commands:
bash
ast test
ast test --update-snapshots
ast test --no-snapshotBehavior:
- snapshots are stored in the configured snapshot directory
--update-snapshotswrites new or changed values--no-snapshotdisables snapshot assertions for the run
See also:
