Skip to content

Commit

Permalink
Update README.md with missing .calls array
Browse files Browse the repository at this point in the history
Add missing section, and fix code sample correspondingly
  • Loading branch information
codingthat authored and dead-claudia committed Aug 30, 2024
1 parent dbce1af commit 8d015e2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ o.spec("call()", function() {

o(spy.callCount).equals(1)
o(spy.args[0]).equals(1)
o(spy.calls[0]).deepEquals([1])
o(spy.calls[0].args).deepEquals([1])
})
})
```
Expand Down Expand Up @@ -538,7 +538,7 @@ Declares that only a single test should be run, instead of all of them

### Function o.spy([Function fn])

Returns a function that records the number of times it gets called, and its arguments
Returns a function that records the number of times it gets called, and each call's arguments

#### Number o.spy().callCount

Expand All @@ -548,6 +548,10 @@ The number of times the function has been called

The arguments that were passed to the function in the last time it was called

#### Array<any> o.spy().calls

An array representing all the times the function was called. Each array value is an object containing the `this` calling context and an `args` array.

---

### void o.run([Function reporter])
Expand Down

0 comments on commit 8d015e2

Please sign in to comment.