From 1e5daa2de3671ff0b5af5839b886050208cc3ddc Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 21 Dec 2016 10:15:42 -0800 Subject: [PATCH] doc: improve common.mustCall() explanation PR-URL: https://github.com/nodejs/node/pull/10390 Reviewed-By: Colin Ihrig Reviewed-By: Julian Duque Reviewed-By: Luigi Pinca Reviewed-By: Italo A. Casas Reviewed-By: James M Snell --- test/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/README.md b/test/README.md index 1c3303435db517..8d8cec44919720 100644 --- a/test/README.md +++ b/test/README.md @@ -290,8 +290,11 @@ Array of IPV6 hosts. ### mustCall(fn[, expected]) * fn [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) * expected [<Number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) default = 1 +* return [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) -Number of times `fn` should be called. +Returns a function that calls `fn`. If the returned function has not been called +exactly `expected` number of times when the test is complete, then the test will +fail. ### nodeProcessAborted(exitCode, signal) * `exitCode` [<Number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type)