Skip to content
Playground(another site)

bynk.stub.rhs_type

Error A test stub … returns <value> right-hand side does not match the operation's return type.

A stub … returns <value> stands in for a real provider, so the value must have the type the operation declares, as the real result would. Meter.read yields an Int, so it returns 7, not a string; the Effect is supplied for you. Change the value, or stub the operation you meant. To inject a failure, write fails instead of a value.

Example

demo/meter.bynk
capability Meter { … }
// tests/meter.test.bynk
stub Meter.read() returns "seven" // ✗ a String, not an Int
stub Meter.read() returns 7 // ✓

In the Book

See also

  • Every code in its category, Stubs, on the diagnostic index.
  • bynk explain bynk.stub.rhs_type shows the same from the installed toolchain, without a network.