Skip to content
Playground(another site)

bynk.test.snapshot_needs_unit_suite

Error A snapshot is taken in a system-tier case or in an integration or system suite; snapshots are stored per unit suite file and compared in the unit harness.

A snapshot is stored in a file beside its unit suite and compared by the unit harness, so matches snapshot works only in a unit-tier case of a suite that tests a unit. A system case, or an integration or system suite, has no store to compare against. Take the snapshot in a unit case. See bynk.test.snapshot_in_property for the other place it is refused.

Example

tests/api.test.bynk
suite demo.api as system {
case "one n" {
expect 3 matches snapshot "n" // ✗ no snapshot store at `system`
}
}
suite demo.api { // ✓ a unit suite
case "one n" {
expect 3 matches snapshot "n"
}
}

In the Book

See also

  • The grammar rule it governs: snapshot_expr.
  • Every code in its category, Tests, on the diagnostic index.
  • bynk explain bynk.test.snapshot_needs_unit_suite shows the same from the installed toolchain, without a network.