@tramvai/test-pw 5.10.0 → 5.14.9
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:
|
|
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 =
|
|
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 =
|
|
46
|
-
const serverOutput =
|
|
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
|
-
|
|
62
|
-
|
|
59
|
+
server.stdout?.setEncoding('utf-8');
|
|
60
|
+
server.stderr?.setEncoding('utf-8');
|
|
63
61
|
// @todo pipe only when server run is failed
|
|
64
|
-
|
|
65
|
-
|
|
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:
|
|
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 =
|
|
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 =
|
|
57
|
-
const serverOutput =
|
|
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
|
-
|
|
73
|
-
|
|
70
|
+
server.stdout?.setEncoding('utf-8');
|
|
71
|
+
server.stderr?.setEncoding('utf-8');
|
|
74
72
|
// @todo pipe only when server run is failed
|
|
75
|
-
|
|
76
|
-
|
|
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:
|
|
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
|
|
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:
|
|
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
|
|
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.
|
|
3
|
+
"version": "5.14.9",
|
|
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.
|
|
22
|
-
"@tramvai/tokens-router": "5.
|
|
21
|
+
"@tramvai/test-integration": "5.14.9",
|
|
22
|
+
"@tramvai/tokens-router": "5.14.9",
|
|
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.
|
|
38
|
+
"@tramvai/cli": "5.14.9",
|
|
39
39
|
"@playwright/test": "1.29.0",
|
|
40
40
|
"playwright-core": "1.29.0"
|
|
41
41
|
},
|