@tramvai/test-integration 3.26.3 → 3.27.3
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.
- package/lib/app/utils.es.js +10 -3
- package/lib/app/utils.js +10 -3
- package/package.json +3 -3
package/lib/app/utils.es.js
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
+
import { Server } from 'https';
|
|
2
|
+
|
|
3
|
+
const extractHttpProtocolFromServerInstance = (server) => {
|
|
4
|
+
if (server instanceof Server)
|
|
5
|
+
return 'https';
|
|
6
|
+
return 'http';
|
|
7
|
+
};
|
|
1
8
|
const getServerUrl = ({ server }) => {
|
|
2
9
|
const { port } = server === null || server === void 0 ? void 0 : server.address();
|
|
3
|
-
return
|
|
10
|
+
return `${extractHttpProtocolFromServerInstance(server)}://localhost:${port}`;
|
|
4
11
|
};
|
|
5
12
|
const getStaticUrl = ({ staticServer }) => {
|
|
6
13
|
const { port } = staticServer === null || staticServer === void 0 ? void 0 : staticServer.address();
|
|
7
|
-
return
|
|
14
|
+
return `${extractHttpProtocolFromServerInstance(staticServer)}://localhost:${port}`;
|
|
8
15
|
};
|
|
9
16
|
const getUtilityServerUrl = (env, { server }) => {
|
|
10
17
|
const { port } = server === null || server === void 0 ? void 0 : server.address();
|
|
11
|
-
return
|
|
18
|
+
return `${extractHttpProtocolFromServerInstance(server)}://localhost:${(env === null || env === void 0 ? void 0 : env.UTILITY_SERVER_PORT) || port}`;
|
|
12
19
|
};
|
|
13
20
|
|
|
14
21
|
export { getServerUrl, getStaticUrl, getUtilityServerUrl };
|
package/lib/app/utils.js
CHANGED
|
@@ -2,17 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var https = require('https');
|
|
6
|
+
|
|
7
|
+
const extractHttpProtocolFromServerInstance = (server) => {
|
|
8
|
+
if (server instanceof https.Server)
|
|
9
|
+
return 'https';
|
|
10
|
+
return 'http';
|
|
11
|
+
};
|
|
5
12
|
const getServerUrl = ({ server }) => {
|
|
6
13
|
const { port } = server === null || server === void 0 ? void 0 : server.address();
|
|
7
|
-
return
|
|
14
|
+
return `${extractHttpProtocolFromServerInstance(server)}://localhost:${port}`;
|
|
8
15
|
};
|
|
9
16
|
const getStaticUrl = ({ staticServer }) => {
|
|
10
17
|
const { port } = staticServer === null || staticServer === void 0 ? void 0 : staticServer.address();
|
|
11
|
-
return
|
|
18
|
+
return `${extractHttpProtocolFromServerInstance(staticServer)}://localhost:${port}`;
|
|
12
19
|
};
|
|
13
20
|
const getUtilityServerUrl = (env, { server }) => {
|
|
14
21
|
const { port } = server === null || server === void 0 ? void 0 : server.address();
|
|
15
|
-
return
|
|
22
|
+
return `${extractHttpProtocolFromServerInstance(server)}://localhost:${(env === null || env === void 0 ? void 0 : env.UTILITY_SERVER_PORT) || port}`;
|
|
16
23
|
};
|
|
17
24
|
|
|
18
25
|
exports.getServerUrl = getServerUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tramvai/test-integration",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.27.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@tinkoff/mocker": "3.0.1",
|
|
24
|
-
"@tramvai/test-helpers": "3.
|
|
24
|
+
"@tramvai/test-helpers": "3.27.3",
|
|
25
25
|
"env-ci": "^5.0.2",
|
|
26
26
|
"utility-types": "^3.10.0",
|
|
27
27
|
"wait-on": "^5.3.0"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"@tinkoff/utils": "^2.1.2",
|
|
31
|
-
"@tramvai/cli": "3.
|
|
31
|
+
"@tramvai/cli": "3.27.3",
|
|
32
32
|
"tslib": "^2.4.0"
|
|
33
33
|
},
|
|
34
34
|
"license": "Apache-2.0",
|