Strange behavior of the assertRejects() method.
Behavior of the
method.
Let's look at the following example:
execute:
output:
Note that
execute:
output:
What am I doing wrong? Is this a bug in the
understanding?
assertRejects() method.assertRejects() fails when a non-stubbed method is called before the stubbedmethod.
Let's look at the following example:
execute:
deno testoutput:
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 testoutput:
What am I doing wrong? Is this a bug in the
stub() method, or what am I notunderstanding?
