aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar wing <wing@wii.ng> 2023-09-13 22:08:09 +0100
committerGravatar GitHub <noreply@github.com> 2023-09-13 14:08:09 -0700
commit1c570b41bc6fa2b10e0af7190c83d7dca99d668b (patch)
tree62e5b1573425ada27611e85c652132c1f4fd7264
parent500bd15fb5474ca9d2a6451c2fa00ba225533145 (diff)
downloadbun-1c570b41bc6fa2b10e0af7190c83d7dca99d668b.tar.gz
bun-1c570b41bc6fa2b10e0af7190c83d7dca99d668b.tar.zst
bun-1c570b41bc6fa2b10e0af7190c83d7dca99d668b.zip
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.
-rw-r--r--docs/guides/test/spy-on.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/docs/guides/test/spy-on.md b/docs/guides/test/spy-on.md
index 003c05d96..4d4902f9d 100644
--- a/docs/guides/test/spy-on.md
+++ b/docs/guides/test/spy-on.md
@@ -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" ]]);
+ })
```