bynk.observe.trace_outside_test
Error trace(Cap.op) appears outside a case body.
trace(Cap.op) reads the calls a test has recorded through a capability. Only a test records them, so it is allowed only in a case body, never in a service, an agent or a function. Remove it from the code under test and read the trace in the test, or observe the call with expect Cap.op called.
Example
let calls = trace(Logger.log) // ✗ in the service
// tests/t.test.bynkexpect trace(Logger.log).length() == 1 // ✓ in a caseIn the Book
See also
- Every code in its category, Observation, on the diagnostic index.
bynk explain bynk.observe.trace_outside_testshows the same from the installed toolchain, without a network.