Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

unexpected-mitm

Package Overview
Dependencies
Maintainers
5
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

unexpected-mitm - npm Package Compare versions

Comparing version 9.3.6 to 9.4.0

16

lib/unexpectedMitm.js

@@ -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>",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc