Skip to content
Playground(another site)

bynk.expect.faults_not_effect

Error A fault claim's subject (expect <call> faults) is not an effectful call: a value, or a call whose type is not Effect[_].

expect <call> faults claims that an effectful call throws, for instance because a stub … fails. Only a call can fault, so the subject must be the call itself, with type Effect[_]. A value already bound, or a pure method on one, has nothing left to throw. Write the call inside the claim, not a name bound from it. A fault that is not claimed fails the case.

Example

tests/vault.test.bynk
let label = "sealed"
expect label.length() faults // ✗ a pure method, not an effectful call
expect box.call() faults // ✓ the call that faults

In the Book

See also

  • The grammar rule it governs: faults_expr.
  • Every code in its category, Expectations, on the diagnostic index.
  • bynk explain bynk.expect.faults_not_effect shows the same from the installed toolchain, without a network.