node-tdd 3.5.2 → 3.5.4

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,8 +6,8 @@ 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 compareUrls from 'compare-urls';
10
9
  import nockCommon from 'nock/lib/common.js';
10
+ import compareUrls from '../util/compare-urls.js';
11
11
  import nockListener from './request-recorder/nock-listener.js';
12
12
  import nockMock from './request-recorder/nock-mock.js';
13
13
  import healSqsSendMessageBatch from './request-recorder/heal-sqs-send-message-batch.js';
@@ -177,6 +177,9 @@ export default (opts) => {
177
177
  if (!compareUrls(pendingMocks[idx].record.path, requestPath)) {
178
178
  pendingMocks[idx].record.path = requestPath;
179
179
  }
180
+ if (compareUrls(pendingMocks[idx].record.path, scope.path)) {
181
+ pendingMocks[idx].record.path = scope.path;
182
+ }
180
183
  return scope.path;
181
184
  }
182
185
  return requestPath;
@@ -0,0 +1,11 @@
1
+ import normalizeUrl from 'normalize-url';
2
+
3
+ export default (firstUrl, secondUrl) => {
4
+ if (firstUrl === secondUrl) {
5
+ return true;
6
+ }
7
+ const options = {
8
+ removeTrailingSlash: false
9
+ };
10
+ return normalizeUrl(firstUrl, options) === normalizeUrl(secondUrl, options);
11
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "node-tdd",
3
3
  "type": "module",
4
- "version": "3.5.2",
4
+ "version": "3.5.4",
5
5
  "description": "Drop in extension for mocha to abstract commonly used test setups",
6
6
  "main": "lib/index.js",
7
7
  "scripts": {
@@ -75,13 +75,13 @@
75
75
  ],
76
76
  "dependencies": {
77
77
  "callsites": "4.0.0",
78
- "compare-urls": "2.0.0",
79
78
  "joi-strict": "2.0.1",
80
79
  "lodash.clonedeep": "4.5.0",
81
80
  "lodash.get": "4.4.2",
82
81
  "lru-cache-ext": "3.0.2",
83
82
  "minimist": "1.2.8",
84
83
  "nock": "13.3.2",
84
+ "normalize-url": "2.0.1",
85
85
  "object-scan": "18.5.1",
86
86
  "smart-fs": "3.0.1",
87
87
  "timekeeper": "2.2.0",