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

node-tdd

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-tdd - npm Package Compare versions

Comparing version 5.2.2 to 5.2.3

lib/modules/request-recorder/update-and-restore-modifiers.js

16

lib/modules/request-recorder.js

@@ -9,3 +9,2 @@ import assert from 'assert';

import cloneDeep from 'lodash.clonedeep';
import isEqual from 'lodash.isequal';
import nockCommon from 'nock/lib/common.js';

@@ -26,3 +25,3 @@ import compareUrls from '../util/compare-urls.js';

} from './request-recorder/util.js';
import healBody from './request-recorder/heal-body.js';
import updateAndRestoreModifiers from './request-recorder/update-and-restore-modifiers.js';

@@ -185,5 +184,3 @@ const nockBack = nock.back;

const requestBody = nullAsString(tryParseJson(body));
if (!isEqual(scope.body, requestBody)) {
pendingMocks[idx].record.body = healBody(pendingMocks[idx].record.body, scope.body, requestBody);
}
updateAndRestoreModifiers(pendingMocks[idx].record, 'body', scope.body, requestBody);
return scope.body;

@@ -243,2 +240,3 @@ }

if (anyFlagPresent(['magic', 'response'])) {
const interceptorBody = tryParseJson(interceptor.body);
const responseBody = tryParseJson([

@@ -250,7 +248,5 @@ healSqs

));
if (!isEqual(interceptor.body, responseBody)) {
// eslint-disable-next-line no-param-reassign
interceptor.body = responseBody;
pendingMocks[idx].record.response = responseBody;
}
updateAndRestoreModifiers(pendingMocks[idx].record, 'response', interceptorBody, responseBody);
// eslint-disable-next-line no-param-reassign
interceptor.body = responseBody;
}

@@ -257,0 +253,0 @@

{
"name": "node-tdd",
"type": "module",
"version": "5.2.2",
"version": "5.2.3",
"description": "Drop in extension for mocha to abstract commonly used test setups",

@@ -81,3 +81,2 @@ "main": "lib/index.js",

"lodash.get": "4.4.2",
"lodash.isequal": "4.5.0",
"lru-cache-ext": "4.0.0",

@@ -84,0 +83,0 @@ "minimist": "1.2.8",

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