Skip to content
Playground(another site)

bynk.stub.after_type

Error A test stub … returns <value> after <d> latency is not a Duration.

stub … returns <value> after <delay> makes the stubbed call complete only once the harness clock has advanced by that delay, so the delay must be a Duration, such as 3.seconds. A bare number has no unit, so it is refused rather than guessed at as milliseconds or seconds.

Example

demo/meter.bynk
capability Meter { … }
// tests/meter.test.bynk
stub Meter.read() returns 7 after 3 // ✗ no unit
stub Meter.read() returns 7 after 3.seconds // ✓

In the Book

See also

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