unexpected-mitm
Advanced tools
Comparing version 9.3.6 to 9.4.0
@@ -864,3 +864,3 @@ /* global setImmediate, process, after, console */ | ||
}) | ||
.addAssertion('<any> with http mocked out [and verified] [with extra info] <array|object> <assertion>', function (expect, subject, requestDescriptions) { // ... | ||
.addAssertion('<any> with http mocked out [and verified] [with extra info] [allowing modification] <array|object> <assertion>', function (expect, subject, requestDescriptions) { // ... | ||
expect.errorMode = 'nested'; | ||
@@ -877,6 +877,8 @@ var mitm = createMitm(); | ||
} | ||
} else { | ||
} else if (!expect.flags['allowing modification']) { | ||
// duplicate descriptions to allow array consumption | ||
requestDescriptions = requestDescriptions.slice(0); | ||
} | ||
var nextRequestDescriptionIndex = 0; | ||
@@ -924,4 +926,5 @@ var verifyBlocks = requestDescriptions.map(function (description) { | ||
} | ||
var currentDescription = requestDescriptions.shift(), | ||
hasRequestDescription = !!currentDescription, | ||
var currentDescription = requestDescriptions[nextRequestDescriptionIndex]; | ||
nextRequestDescriptionIndex += 1; | ||
var hasRequestDescription = !!currentDescription, | ||
metadata = | ||
@@ -1135,7 +1138,8 @@ _.defaults( | ||
*/ | ||
var hasRemainingRequestDescriptions = requestDescriptions.length > 0; | ||
var hasRemainingRequestDescriptions = nextRequestDescriptionIndex < requestDescriptions.length; | ||
if (hasRemainingRequestDescriptions) { | ||
// exhaust remaining mocks using a promises chain | ||
(function nextItem() { | ||
var remainingDescription = requestDescriptions.shift(); | ||
var remainingDescription = requestDescriptions[nextRequestDescriptionIndex]; | ||
nextRequestDescriptionIndex += 1; | ||
if (remainingDescription) { | ||
@@ -1142,0 +1146,0 @@ var expectedRequestProperties; |
{ | ||
"name": "unexpected-mitm", | ||
"version": "9.3.6", | ||
"version": "9.4.0", | ||
"description": "Unexpected plugin for the mitm library", | ||
@@ -5,0 +5,0 @@ "author": "Andreas Lind <andreas@one.com>", |
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
59586
1084