bynk.test.peek_outside_case
Error D1.peek is used outside an integration or system case; only those tiers stand up a participant's test database.
D1.peek(<participant>.<Capability>) gives an integration or system case a read-only handle on a participant's test database. Only those tiers stand one up, so the handle is refused in a unit case, a property, and in the app's own code. A unit case reads the capability it stubs.
Example
suite shop.orders { case "peeks" { let db = D1.peek(shop.orders.Orders) // ✗ a unit suite has no participant database expect true }}
suite shop.orders as system { case "peeks" { let db = D1.peek(shop.orders.Orders) // ✓ expect true }}In the Book
See also
- The grammar rule it governs:
case. - Every code in its category, Tests, on the diagnostic index.
bynk explain bynk.test.peek_outside_caseshows the same from the installed toolchain, without a network.