@tramvai/test-pw 5.10.0 → 5.14.10

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.
@@ -12,7 +12,6 @@ import { buildCli } from '@tramvai/test-integration';
12
12
  */
13
13
  const buildAppFixture = [
14
14
  async ({ appTarget, buildOptions }, use) => {
15
- var _a;
16
15
  await buildCli('target' in appTarget
17
16
  ? appTarget.target
18
17
  : mergeDeep(appTarget.config, {
@@ -21,7 +20,7 @@ const buildAppFixture = [
21
20
  root: appTarget.cwd,
22
21
  }), {
23
22
  ...buildOptions,
24
- rootDir: (_a = appTarget.cwd) !== null && _a !== void 0 ? _a : path.dirname(path.resolve(module.parent.filename, '.')),
23
+ rootDir: appTarget.cwd ?? path.dirname(path.resolve(module.parent.filename, '.')),
25
24
  });
26
25
  await use();
27
26
  // @todo clear dist?
@@ -36,14 +35,13 @@ const buildAppFixture = [
36
35
  */
37
36
  const appServerFixture = [
38
37
  async ({ appTarget, appServerOptions, buildApp }, use) => {
39
- var _a, _b, _c, _d, _e, _f, _g;
40
38
  const { env = {}, output = {} } = appServerOptions;
41
- const root = (_a = appTarget.cwd) !== null && _a !== void 0 ? _a : path.dirname(path.resolve(module.parent.filename, '.'));
39
+ const root = appTarget.cwd ?? path.dirname(path.resolve(module.parent.filename, '.'));
42
40
  const port = await getPort();
43
41
  const staticPort = await getPort();
44
42
  const readinessProbePath = `http://localhost:${port}/readyz`;
45
- const clientOutput = (_b = output.client) !== null && _b !== void 0 ? _b : path.join('dist', 'client');
46
- const serverOutput = (_c = output.server) !== null && _c !== void 0 ? _c : path.join('dist', 'server');
43
+ const clientOutput = output.client ?? path.join('dist', 'client');
44
+ const serverOutput = output.server ?? path.join('dist', 'server');
47
45
  const server = node(path.resolve(root, serverOutput, 'server.js'), [], {
48
46
  cwd: root,
49
47
  env: {
@@ -58,11 +56,11 @@ const appServerFixture = [
58
56
  });
59
57
  // playwright can only collect string-form stdio into the test report
60
58
  // https://github.com/microsoft/playwright/issues/23993
61
- (_d = server.stdout) === null || _d === void 0 ? void 0 : _d.setEncoding('utf-8');
62
- (_e = server.stderr) === null || _e === void 0 ? void 0 : _e.setEncoding('utf-8');
59
+ server.stdout?.setEncoding('utf-8');
60
+ server.stderr?.setEncoding('utf-8');
63
61
  // @todo pipe only when server run is failed
64
- (_f = server.stdout) === null || _f === void 0 ? void 0 : _f.pipe(process.stdout);
65
- (_g = server.stderr) === null || _g === void 0 ? void 0 : _g.pipe(process.stderr);
62
+ server.stdout?.pipe(process.stdout);
63
+ server.stderr?.pipe(process.stderr);
66
64
  await Promise.race([
67
65
  server,
68
66
  waitOn({
@@ -23,7 +23,6 @@ var getPort__default = /*#__PURE__*/_interopDefaultLegacy(getPort);
23
23
  */
24
24
  const buildAppFixture = [
25
25
  async ({ appTarget, buildOptions }, use) => {
26
- var _a;
27
26
  await testIntegration.buildCli('target' in appTarget
28
27
  ? appTarget.target
29
28
  : mergeDeep__default["default"](appTarget.config, {
@@ -32,7 +31,7 @@ const buildAppFixture = [
32
31
  root: appTarget.cwd,
33
32
  }), {
34
33
  ...buildOptions,
35
- rootDir: (_a = appTarget.cwd) !== null && _a !== void 0 ? _a : path__default["default"].dirname(path__default["default"].resolve(module.parent.filename, '.')),
34
+ rootDir: appTarget.cwd ?? path__default["default"].dirname(path__default["default"].resolve(module.parent.filename, '.')),
36
35
  });
37
36
  await use();
38
37
  // @todo clear dist?
@@ -47,14 +46,13 @@ const buildAppFixture = [
47
46
  */
48
47
  const appServerFixture = [
49
48
  async ({ appTarget, appServerOptions, buildApp }, use) => {
50
- var _a, _b, _c, _d, _e, _f, _g;
51
49
  const { env = {}, output = {} } = appServerOptions;
52
- const root = (_a = appTarget.cwd) !== null && _a !== void 0 ? _a : path__default["default"].dirname(path__default["default"].resolve(module.parent.filename, '.'));
50
+ const root = appTarget.cwd ?? path__default["default"].dirname(path__default["default"].resolve(module.parent.filename, '.'));
53
51
  const port = await getPort__default["default"]();
54
52
  const staticPort = await getPort__default["default"]();
55
53
  const readinessProbePath = `http://localhost:${port}/readyz`;
56
- const clientOutput = (_b = output.client) !== null && _b !== void 0 ? _b : path__default["default"].join('dist', 'client');
57
- const serverOutput = (_c = output.server) !== null && _c !== void 0 ? _c : path__default["default"].join('dist', 'server');
54
+ const clientOutput = output.client ?? path__default["default"].join('dist', 'client');
55
+ const serverOutput = output.server ?? path__default["default"].join('dist', 'server');
58
56
  const server = execa.node(path__default["default"].resolve(root, serverOutput, 'server.js'), [], {
59
57
  cwd: root,
60
58
  env: {
@@ -69,11 +67,11 @@ const appServerFixture = [
69
67
  });
70
68
  // playwright can only collect string-form stdio into the test report
71
69
  // https://github.com/microsoft/playwright/issues/23993
72
- (_d = server.stdout) === null || _d === void 0 ? void 0 : _d.setEncoding('utf-8');
73
- (_e = server.stderr) === null || _e === void 0 ? void 0 : _e.setEncoding('utf-8');
70
+ server.stdout?.setEncoding('utf-8');
71
+ server.stderr?.setEncoding('utf-8');
74
72
  // @todo pipe only when server run is failed
75
- (_f = server.stdout) === null || _f === void 0 ? void 0 : _f.pipe(process.stdout);
76
- (_g = server.stderr) === null || _g === void 0 ? void 0 : _g.pipe(process.stderr);
73
+ server.stdout?.pipe(process.stdout);
74
+ server.stderr?.pipe(process.stderr);
77
75
  await Promise.race([
78
76
  server,
79
77
  waitOn__default["default"]({
@@ -10,7 +10,6 @@ import { startCli } from '@tramvai/test-integration';
10
10
  */
11
11
  const startAppFixture = [
12
12
  async ({ appTarget, startOptions }, use) => {
13
- var _a;
14
13
  let app;
15
14
  try {
16
15
  app = await startCli('target' in appTarget
@@ -21,14 +20,14 @@ const startAppFixture = [
21
20
  root: appTarget.cwd,
22
21
  }), {
23
22
  ...startOptions,
24
- rootDir: (_a = appTarget.cwd) !== null && _a !== void 0 ? _a : path.dirname(path.resolve(module.parent.filename, '.')),
23
+ rootDir: appTarget.cwd ?? path.dirname(path.resolve(module.parent.filename, '.')),
25
24
  });
26
25
  await use(app);
27
26
  await app.close();
28
27
  }
29
28
  catch (error) {
30
29
  console.error(`startApp fixture failed:`, error);
31
- await (app === null || app === void 0 ? void 0 : app.close());
30
+ await app?.close();
32
31
  throw error;
33
32
  }
34
33
  },
@@ -19,7 +19,6 @@ var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
19
19
  */
20
20
  const startAppFixture = [
21
21
  async ({ appTarget, startOptions }, use) => {
22
- var _a;
23
22
  let app;
24
23
  try {
25
24
  app = await testIntegration.startCli('target' in appTarget
@@ -30,14 +29,14 @@ const startAppFixture = [
30
29
  root: appTarget.cwd,
31
30
  }), {
32
31
  ...startOptions,
33
- rootDir: (_a = appTarget.cwd) !== null && _a !== void 0 ? _a : path__default["default"].dirname(path__default["default"].resolve(module.parent.filename, '.')),
32
+ rootDir: appTarget.cwd ?? path__default["default"].dirname(path__default["default"].resolve(module.parent.filename, '.')),
34
33
  });
35
34
  await use(app);
36
35
  await app.close();
37
36
  }
38
37
  catch (error) {
39
38
  console.error(`startApp fixture failed:`, error);
40
- await (app === null || app === void 0 ? void 0 : app.close());
39
+ await app?.close();
41
40
  throw error;
42
41
  }
43
42
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/test-pw",
3
- "version": "5.10.0",
3
+ "version": "5.14.10",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@tinkoff/utils": "^2.1.2",
21
- "@tramvai/test-integration": "5.10.0",
22
- "@tramvai/tokens-router": "5.10.0",
21
+ "@tramvai/test-integration": "5.14.10",
22
+ "@tramvai/tokens-router": "5.14.10",
23
23
  "console-with-style": "^1.1.0",
24
24
  "get-port": "^5.1.1",
25
25
  "supports-color": "8.1.1",
@@ -35,7 +35,7 @@
35
35
  "@types/supports-color": "^8.1.1",
36
36
  "@types/env-ci": "^3.1.0",
37
37
  "@types/wait-on": "^5.2.0",
38
- "@tramvai/cli": "5.10.0",
38
+ "@tramvai/cli": "5.14.10",
39
39
  "@playwright/test": "1.29.0",
40
40
  "playwright-core": "1.29.0"
41
41
  },