node-tdd 4.0.4 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,7 @@ import Joi from 'joi-strict';
6
6
  import nock from 'nock';
7
7
  import get from 'lodash.get';
8
8
  import cloneDeep from 'lodash.clonedeep';
9
+ import isEqual from 'lodash.isequal';
9
10
  import nockCommon from 'nock/lib/common.js';
10
11
  import compareUrls from '../util/compare-urls.js';
11
12
  import nockListener from './request-recorder/nock-listener.js';
@@ -227,9 +228,11 @@ export default (opts) => {
227
228
  (respBody, fn) => fn(requestBodyString, respBody, scope, req),
228
229
  interceptor.body
229
230
  ));
230
- // eslint-disable-next-line no-param-reassign
231
- interceptor.body = responseBody;
232
- pendingMocks[idx].record.response = responseBody;
231
+ if (!isEqual(interceptor.body, responseBody)) {
232
+ // eslint-disable-next-line no-param-reassign
233
+ interceptor.body = responseBody;
234
+ pendingMocks[idx].record.response = responseBody;
235
+ }
233
236
  }
234
237
 
235
238
  expectedCassette.push(pendingMocks[idx].record);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "node-tdd",
3
3
  "type": "module",
4
- "version": "4.0.4",
4
+ "version": "4.0.5",
5
5
  "description": "Drop in extension for mocha to abstract commonly used test setups",
6
6
  "main": "lib/index.js",
7
7
  "scripts": {
@@ -78,6 +78,7 @@
78
78
  "joi-strict": "3.0.1",
79
79
  "lodash.clonedeep": "4.5.0",
80
80
  "lodash.get": "4.4.2",
81
+ "lodash.isequal": "4.5.0",
81
82
  "lru-cache-ext": "4.0.0",
82
83
  "minimist": "1.2.8",
83
84
  "nock": "13.4.0",