mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
docs(guide): fix expect assertion example in guide for spyOn (#5294)
Fixes example with `spyOn` and assertions. The example failed because the spied function would be called once but the expectation asserted 0 calls.
This commit is contained in:
@@ -36,7 +36,7 @@ Once the spy is created, it can be used to write `expect` assertions relating to
|
||||
+ test("turtles", ()=>{
|
||||
+ expect(spy).toHaveBeenCalledTimes(0);
|
||||
+ leo.sayHi("pizza");
|
||||
+ expect(spy).toHaveBeenCalledTimes(0);
|
||||
+ expect(spy).toHaveBeenCalledTimes(1);
|
||||
+ expect(spy.mock.calls).toEqual([[ "pizza" ]]);
|
||||
+ })
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user