Skip to content

Commit c210c81

Browse files
Trottevanlucas
authored andcommitted
doc: improve common.mustCall() explanation
PR-URL: #10390 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Julian Duque <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Italo A. Casas <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent edc0267 commit c210c81

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

test/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,11 @@ Array of IPV6 hosts.
290290
### mustCall(fn[, expected])
291291
* fn [&lt;Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
292292
* expected [&lt;Number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) default = 1
293+
* return [&lt;Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function)
293294

294-
Number of times `fn` should be called.
295+
Returns a function that calls `fn`. If the returned function has not been called
296+
exactly `expected` number of times when the test is complete, then the test will
297+
fail.
295298

296299
### nodeProcessAborted(exitCode, signal)
297300
* `exitCode` [&lt;Number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type)

0 commit comments

Comments
 (0)