We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7b2d8ad commit 4fb53a0Copy full SHA for 4fb53a0
test/common/index.js
@@ -34,13 +34,16 @@ exports.mustCall = function(fn, exact) {
34
return _mustCallInner(fn, exact, 'exact');
35
};
36
37
-function _mustCallInner(fn, criteria = 1, field) {
+function _mustCallInner(fn, criteria, field) {
38
if (typeof fn === 'number') {
39
criteria = fn;
40
fn = noop;
41
} else if (fn === undefined) {
42
43
}
44
+ if (criteria === undefined) {
45
+ criteria = 1;
46
+ }
47
48
if (typeof criteria !== 'number')
49
throw new TypeError(`Invalid ${field} value: ${criteria}`);
0 commit comments