elvitin
Strange behavior of the assertRejects() method.
Behavior of the
assertRejects()
method.
assertRejects()
fails when a non-stubbed method is called before the stubbed
method.
Let's look at the following example:
execute: deno test
output:
Note that bar()
is stubbed to reject the promise with an error. However,
bar()
only rejects with an error if foo()
is not called:
execute: deno test
output:
What am I doing wrong? Is this a bug in the stub()
method, or what am I not
understanding?3 replies