Skip to content
Playground(another site)

bynk.test.faults_needs_in_process

Error A system-tier case claims a fault with expect <call> faults, or a fault claim at any tier is driven by Nobody, by Forged, by Stale, by Expired, by WrongIssuer, by WrongAudience, by WrongAlgorithm or by NoSubject; at system a fault reaches the case as an error response from the deployed Worker, never a throw, so the claim belongs at unit or integration.

expect <call> faults claims that a handler throws. At system a fault reaches the case as an error response from the deployed Worker, not a throw, so claim it at unit or integration, or assert the response. A claim driven by Nobody, Forged or Stale fails at every tier: only a system case reaches the auth seam that refuses the request. Assert Rejected(Unauthorized) in a system case instead.

Example

tests/api.test.bynk
expect api.GET("/a") by Nobody faults // ✗ a seam rejects, nothing throws
case "no token is refused" as system { // ✓
let r <- api.GET("/a") by Nobody
expect r is Rejected(Unauthorized)
}

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.faults_needs_in_process shows the same from the installed toolchain, without a network.