@tramvai/test-integration 3.27.5 → 3.31.0

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.
@@ -11,6 +11,7 @@ export interface StartCliOptions extends Omit<StartOptions, 'config' | 'target'>
11
11
  export declare const startCli: (targetOrConfig: StartOptions['target'] | StartOptions['config'], { enableRebuild, env, logger, ...cliOptions }?: StartCliOptions) => Promise<{
12
12
  serverUrl: string;
13
13
  staticUrl: string;
14
+ domain: string;
14
15
  stdout: Writable;
15
16
  stderr: Writable;
16
17
  request: (path: string, { method, body, contentType, headers, }?: {
@@ -5,8 +5,8 @@ import envCi from 'env-ci';
5
5
  import { start } from '@tramvai/cli';
6
6
  import waitOn from 'wait-on';
7
7
  import { requestFactory, renderFactory } from '@tramvai/test-helpers';
8
- import { getServerUrl, getStaticUrl, getUtilityServerUrl } from './utils.es.js';
9
- export { getServerUrl, getStaticUrl, getUtilityServerUrl } from './utils.es.js';
8
+ import { getServerUrl, getStaticUrl, getServerDomain, getUtilityServerUrl } from './utils.es.js';
9
+ export { getServerDomain, getServerUrl, getStaticUrl, getUtilityServerUrl } from './utils.es.js';
10
10
  import { wrapPapi } from './papi.es.js';
11
11
  import { wrapMocker } from './mocker.es.js';
12
12
 
@@ -62,6 +62,7 @@ const startCli = async (targetOrConfig, { enableRebuild = false, env, logger = c
62
62
  });
63
63
  const serverUrl = getServerUrl(cliResult);
64
64
  const staticUrl = getStaticUrl(cliResult);
65
+ const domain = getServerDomain(cliResult);
65
66
  // @FIXME: the utility port might be defined on the provider level and we don't have access to it
66
67
  // in this case. So the value might be inconsistent with actual utility server (actually, already inconsistent for tincoin)
67
68
  const utilityServerUrl = getUtilityServerUrl(env, cliResult);
@@ -96,6 +97,7 @@ const startCli = async (targetOrConfig, { enableRebuild = false, env, logger = c
96
97
  ...cliResult,
97
98
  serverUrl,
98
99
  staticUrl,
100
+ domain,
99
101
  stdout,
100
102
  stderr,
101
103
  request,
@@ -71,6 +71,7 @@ const startCli = async (targetOrConfig, { enableRebuild = false, env, logger = c
71
71
  });
72
72
  const serverUrl = utils.getServerUrl(cliResult);
73
73
  const staticUrl = utils.getStaticUrl(cliResult);
74
+ const domain = utils.getServerDomain(cliResult);
74
75
  // @FIXME: the utility port might be defined on the provider level and we don't have access to it
75
76
  // in this case. So the value might be inconsistent with actual utility server (actually, already inconsistent for tincoin)
76
77
  const utilityServerUrl = utils.getUtilityServerUrl(env, cliResult);
@@ -105,6 +106,7 @@ const startCli = async (targetOrConfig, { enableRebuild = false, env, logger = c
105
106
  ...cliResult,
106
107
  serverUrl,
107
108
  staticUrl,
109
+ domain,
108
110
  stdout,
109
111
  stderr,
110
112
  request,
@@ -114,6 +116,7 @@ const startCli = async (targetOrConfig, { enableRebuild = false, env, logger = c
114
116
  };
115
117
  };
116
118
 
119
+ exports.getServerDomain = utils.getServerDomain;
117
120
  exports.getServerUrl = utils.getServerUrl;
118
121
  exports.getStaticUrl = utils.getStaticUrl;
119
122
  exports.getUtilityServerUrl = utils.getUtilityServerUrl;
@@ -5,6 +5,7 @@ import type { StartCliOptions } from './startCli';
5
5
  export declare const runFakeApp: (config: Partial<StartOptions['config']>, options?: StartCliOptions) => Promise<{
6
6
  serverUrl: string;
7
7
  staticUrl: string;
8
+ domain: string;
8
9
  stdout: import("stream").Writable;
9
10
  stderr: import("stream").Writable;
10
11
  request: (path: string, { method, body, contentType, headers, }?: {
@@ -4,6 +4,7 @@ import type { StartCliOptions } from './startCli';
4
4
  export declare const runRealApp: (tramvaiConfigRoot: string, appName: string, options: StartCliOptions) => Promise<{
5
5
  serverUrl: string;
6
6
  staticUrl: string;
7
+ domain: string;
7
8
  stdout: import("stream").Writable;
8
9
  stderr: import("stream").Writable;
9
10
  request: (path: string, { method, body, contentType, headers, }?: {
@@ -3,6 +3,7 @@ import type { start } from '@tramvai/cli';
3
3
  import type { StartCliOptions } from './startCli';
4
4
  type CliResult = PromiseType<ReturnType<typeof start>>;
5
5
  export declare const getServerUrl: ({ server }: CliResult) => string;
6
+ export declare const getServerDomain: ({ server }: CliResult) => string;
6
7
  export declare const getStaticUrl: ({ staticServer }: CliResult) => string;
7
8
  export declare const getUtilityServerUrl: (env: StartCliOptions['env'], { server }: CliResult) => string;
8
9
  export {};
@@ -9,6 +9,10 @@ const getServerUrl = ({ server }) => {
9
9
  const { port } = server === null || server === void 0 ? void 0 : server.address();
10
10
  return `${extractHttpProtocolFromServerInstance(server)}://localhost:${port}`;
11
11
  };
12
+ const getServerDomain = ({ server }) => {
13
+ const { port } = server === null || server === void 0 ? void 0 : server.address();
14
+ return `localhost:${port}`;
15
+ };
12
16
  const getStaticUrl = ({ staticServer }) => {
13
17
  const { port } = staticServer === null || staticServer === void 0 ? void 0 : staticServer.address();
14
18
  return `${extractHttpProtocolFromServerInstance(staticServer)}://localhost:${port}`;
@@ -18,4 +22,4 @@ const getUtilityServerUrl = (env, { server }) => {
18
22
  return `${extractHttpProtocolFromServerInstance(server)}://localhost:${(env === null || env === void 0 ? void 0 : env.UTILITY_SERVER_PORT) || port}`;
19
23
  };
20
24
 
21
- export { getServerUrl, getStaticUrl, getUtilityServerUrl };
25
+ export { getServerDomain, getServerUrl, getStaticUrl, getUtilityServerUrl };
package/lib/app/utils.js CHANGED
@@ -13,6 +13,10 @@ const getServerUrl = ({ server }) => {
13
13
  const { port } = server === null || server === void 0 ? void 0 : server.address();
14
14
  return `${extractHttpProtocolFromServerInstance(server)}://localhost:${port}`;
15
15
  };
16
+ const getServerDomain = ({ server }) => {
17
+ const { port } = server === null || server === void 0 ? void 0 : server.address();
18
+ return `localhost:${port}`;
19
+ };
16
20
  const getStaticUrl = ({ staticServer }) => {
17
21
  const { port } = staticServer === null || staticServer === void 0 ? void 0 : staticServer.address();
18
22
  return `${extractHttpProtocolFromServerInstance(staticServer)}://localhost:${port}`;
@@ -22,6 +26,7 @@ const getUtilityServerUrl = (env, { server }) => {
22
26
  return `${extractHttpProtocolFromServerInstance(server)}://localhost:${(env === null || env === void 0 ? void 0 : env.UTILITY_SERVER_PORT) || port}`;
23
27
  };
24
28
 
29
+ exports.getServerDomain = getServerDomain;
25
30
  exports.getServerUrl = getServerUrl;
26
31
  exports.getStaticUrl = getStaticUrl;
27
32
  exports.getUtilityServerUrl = getUtilityServerUrl;
package/lib/index.es.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export { startCli } from './app/startCli.es.js';
2
2
  export { sleep } from './helpers/sleep.es.js';
3
- export { getServerUrl, getStaticUrl, getUtilityServerUrl } from './app/utils.es.js';
3
+ export { getServerDomain, getServerUrl, getStaticUrl, getUtilityServerUrl } from './app/utils.es.js';
package/lib/index.js CHANGED
@@ -10,6 +10,7 @@ var utils = require('./app/utils.js');
10
10
 
11
11
  exports.startCli = startCli.startCli;
12
12
  exports.sleep = sleep.sleep;
13
+ exports.getServerDomain = utils.getServerDomain;
13
14
  exports.getServerUrl = utils.getServerUrl;
14
15
  exports.getStaticUrl = utils.getStaticUrl;
15
16
  exports.getUtilityServerUrl = utils.getUtilityServerUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/test-integration",
3
- "version": "3.27.5",
3
+ "version": "3.31.0",
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.27.5",
24
+ "@tramvai/test-helpers": "3.31.0",
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.27.5",
31
+ "@tramvai/cli": "3.31.0",
32
32
  "tslib": "^2.4.0"
33
33
  },
34
34
  "license": "Apache-2.0",