From 29f19b6d39600a12dc1474dfe64a82bb7a5a2218 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 31 May 2017 22:26:55 -0700 Subject: [PATCH] test: add documentation for common.mustNotCall() PR-URL: https://github.com/nodejs/node/pull/13359 Reviewed-By: Daniel Bevenius Reviewed-By: Luigi Pinca Reviewed-By: Vse Mozhet Byt Reviewed-By: Gibson Fahnestock Reviewed-By: Colin Ihrig Reviewed-By: Michael Dawson Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: David Cai --- test/common/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/common/README.md b/test/common/README.md index 492b5acdea586c..01d19116bdac29 100644 --- a/test/common/README.md +++ b/test/common/README.md @@ -204,6 +204,12 @@ fail. If `fn` is not provided, `common.noop` will be used. +### mustNotCall([msg]) +* `msg` [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type) default = 'function should not have been called' +* return [<Function>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) + +Returns a function that triggers an `AssertionError` if it is invoked. `msg` is used as the error message for the `AssertionError`. + ### nodeProcessAborted(exitCode, signal) * `exitCode` [<Number>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#Number_type) * `signal` [<String>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#String_type)