node-tdd 3.4.1 → 3.4.2
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.
|
@@ -4,6 +4,7 @@ import path from 'path';
|
|
|
4
4
|
import fs from 'smart-fs';
|
|
5
5
|
import Joi from 'joi-strict';
|
|
6
6
|
import nock from 'nock';
|
|
7
|
+
import get from 'lodash.get';
|
|
7
8
|
import cloneDeep from 'lodash.clonedeep';
|
|
8
9
|
import compareUrls from 'compare-urls';
|
|
9
10
|
import nockCommon from 'nock/lib/common.js';
|
|
@@ -120,8 +121,11 @@ export default (opts) => {
|
|
|
120
121
|
}));
|
|
121
122
|
});
|
|
122
123
|
} else if (anyFlagPresent(['stub'])) {
|
|
124
|
+
const host = options.host || options.hostname;
|
|
125
|
+
const port = get(options, 'port', { http: 80, https: 443 }[protocol]);
|
|
126
|
+
const scope = `${protocol}://${host}:${port}`;
|
|
123
127
|
expectedCassette.push({
|
|
124
|
-
scope
|
|
128
|
+
scope,
|
|
125
129
|
method: options.method,
|
|
126
130
|
path: options.path,
|
|
127
131
|
body: tryParseJson(body),
|