unexpected
Advanced tools
Comparing version 10.25.0 to 10.26.0
@@ -578,2 +578,3 @@ var createStandardErrorMessage = require('./createStandardErrorMessage'); | ||
var assertionHandlers = []; | ||
var maxNumberOfArgs = 0; | ||
patterns.forEach(function (pattern) { | ||
@@ -588,3 +589,5 @@ var assertionDeclarations = that.parseAssertion(pattern); | ||
}); | ||
maxNumberOfArgs = Math.max(maxNumberOfArgs, assertionDeclaration.args.reduce(function (previous, argDefinition) { | ||
return previous + (argDefinition.maximum === null ? Infinity : argDefinition.maximum); | ||
}, 0)); | ||
assertionHandlers.push({ | ||
@@ -602,2 +605,5 @@ handler: handler, | ||
}); | ||
if (handler.length - 2 > maxNumberOfArgs) { | ||
throw new Error('The provided assertion handler takes ' + (handler.length - 2) + ' parameters, but the type signature specifies a maximum of ' + maxNumberOfArgs); | ||
} | ||
@@ -604,0 +610,0 @@ assertionHandlers.forEach(function (handler) { |
{ | ||
"name": "unexpected", | ||
"version": "10.25.0", | ||
"version": "10.26.0", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
778392
19434