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:
wing
2023-09-13 22:08:09 +01:00
committed by GitHub
parent 500bd15fb5
commit 1c570b41bc

View File

@@ -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" ]]);
+ })
```