@tramvai/test-integration 1.76.2 → 1.77.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.
@@ -5,8 +5,9 @@ import type { StartOptions } from './types';
5
5
  export * from './utils';
6
6
  export interface StartCliOptions extends Omit<StartOptions, 'config' | 'target'> {
7
7
  enableRebuild?: boolean;
8
+ logger?: Pick<typeof console, 'log' | 'error'>;
8
9
  }
9
- export declare const startCli: (targetOrConfig: StartOptions['target'] | StartOptions['config'], { enableRebuild, env, ...cliOptions }?: StartCliOptions) => Promise<{
10
+ export declare const startCli: (targetOrConfig: StartOptions['target'] | StartOptions['config'], { enableRebuild, env, logger, ...cliOptions }?: StartCliOptions) => Promise<{
10
11
  serverUrl: string;
11
12
  staticUrl: string;
12
13
  stdout: Writable;
package/lib/index.es.js CHANGED
@@ -52,16 +52,16 @@ const wrapMocker = ({ papi }) => {
52
52
  };
53
53
  };
54
54
 
55
- const startCli = async (targetOrConfig, { enableRebuild = false, env, ...cliOptions } = {}) => {
55
+ const startCli = async (targetOrConfig, { enableRebuild = false, env, logger = console, ...cliOptions } = {}) => {
56
56
  const stdout = new Writable({
57
57
  write(chunk, encoding, callback) {
58
- console.log(`[@tramvai/cli] log:`, chunk.toString());
58
+ logger.log(`[@tramvai/cli] log:`, chunk.toString());
59
59
  callback();
60
60
  },
61
61
  });
62
62
  const stderr = new Writable({
63
63
  write(chunk, encoding, callback) {
64
- console.error(`[@tramvai/cli] error:`, chunk.toString());
64
+ logger.error(`[@tramvai/cli] error:`, chunk.toString());
65
65
  callback();
66
66
  },
67
67
  });
@@ -90,7 +90,7 @@ const startCli = async (targetOrConfig, { enableRebuild = false, env, ...cliOpti
90
90
  });
91
91
  }
92
92
  catch (e) {
93
- console.error('[@tramvai/cli] /readyz wait failed:', e);
93
+ logger.error('[@tramvai/cli] /readyz wait failed:', e);
94
94
  throw e;
95
95
  }
96
96
  const request = requestFactory(serverUrl);
package/lib/index.js CHANGED
@@ -61,16 +61,16 @@ const wrapMocker = ({ papi }) => {
61
61
  };
62
62
  };
63
63
 
64
- const startCli = async (targetOrConfig, { enableRebuild = false, env, ...cliOptions } = {}) => {
64
+ const startCli = async (targetOrConfig, { enableRebuild = false, env, logger = console, ...cliOptions } = {}) => {
65
65
  const stdout = new stream.Writable({
66
66
  write(chunk, encoding, callback) {
67
- console.log(`[@tramvai/cli] log:`, chunk.toString());
67
+ logger.log(`[@tramvai/cli] log:`, chunk.toString());
68
68
  callback();
69
69
  },
70
70
  });
71
71
  const stderr = new stream.Writable({
72
72
  write(chunk, encoding, callback) {
73
- console.error(`[@tramvai/cli] error:`, chunk.toString());
73
+ logger.error(`[@tramvai/cli] error:`, chunk.toString());
74
74
  callback();
75
75
  },
76
76
  });
@@ -99,7 +99,7 @@ const startCli = async (targetOrConfig, { enableRebuild = false, env, ...cliOpti
99
99
  });
100
100
  }
101
101
  catch (e) {
102
- console.error('[@tramvai/cli] /readyz wait failed:', e);
102
+ logger.error('[@tramvai/cli] /readyz wait failed:', e);
103
103
  throw e;
104
104
  }
105
105
  const request = testHelpers.requestFactory(serverUrl);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/test-integration",
3
- "version": "1.76.2",
3
+ "version": "1.77.0",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@tinkoff/mocker": "1.5.5",
25
- "@tramvai/test-helpers": "1.76.2",
25
+ "@tramvai/test-helpers": "1.77.0",
26
26
  "@types/supertest": "^2.0.11",
27
27
  "supertest": "^6.1.3",
28
28
  "utility-types": "^3.10.0",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  "peerDependencies": {
32
32
  "@tinkoff/utils": "^2.1.2",
33
- "@tramvai/cli": "1.76.2",
33
+ "@tramvai/cli": "1.77.0",
34
34
  "tslib": "^2.0.3"
35
35
  },
36
36
  "license": "Apache-2.0",