@brillout/test-e2e 0.5.0 → 0.5.2
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/dist/getConfig.d.ts +1 -0
- package/dist/getConfig.js +5 -0
- package/dist/parallel-ci.d.ts +0 -2
- package/dist/parallel-ci.js +1 -7
- package/dist/runAll.js +9 -2
- package/package.json +1 -1
package/dist/getConfig.d.ts
CHANGED
package/dist/getConfig.js
CHANGED
|
@@ -33,6 +33,11 @@ function assertConfig(config) {
|
|
|
33
33
|
else if (key === 'tolerateSkip') {
|
|
34
34
|
(0, utils_1.assertUsage)(typeof val === 'boolean', `${wrongType} boolean`);
|
|
35
35
|
}
|
|
36
|
+
else if (key === 'ci') {
|
|
37
|
+
// Only used by .github/workflows/ci/getTestJobs.mjs
|
|
38
|
+
// https://github.com/brillout/vite-plugin-ssr/blob/4fa329e4081655c39c4c70436ae73e563489439e/.github/workflows/ci/getTestJobs.mjs#L72
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
36
41
|
else {
|
|
37
42
|
(0, utils_1.assertUsage)(false, `${configFileName} unknown config ${key}`);
|
|
38
43
|
}
|
package/dist/parallel-ci.d.ts
CHANGED
package/dist/parallel-ci.js
CHANGED
|
@@ -3,17 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getTestFilesForCurrentJob = exports.
|
|
6
|
+
exports.getTestFilesForCurrentJob = exports.isParallelCI = void 0;
|
|
7
7
|
const utils_1 = require("./utils");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
10
10
|
const cwd = process.cwd();
|
|
11
|
-
function abortIfParallelCI() {
|
|
12
|
-
if (isParallelCI()) {
|
|
13
|
-
process.exit(1);
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.abortIfParallelCI = abortIfParallelCI;
|
|
17
11
|
function isParallelCI() {
|
|
18
12
|
return getTestFilesForCurrentJob() !== null;
|
|
19
13
|
}
|
package/dist/runAll.js
CHANGED
|
@@ -71,6 +71,11 @@ async function runServerAndTests(browser, isSecondAttempt) {
|
|
|
71
71
|
(0, utils_1.assert)(testInfo.startServer);
|
|
72
72
|
(0, utils_1.assert)(testInfo.terminateServer);
|
|
73
73
|
const isFinalAttempt = isSecondAttempt || !testInfo.runInfo.isFlaky;
|
|
74
|
+
const abortMaybe = () => {
|
|
75
|
+
if (isFinalAttempt && (0, parallel_ci_1.isParallelCI)()) {
|
|
76
|
+
process.exit(1);
|
|
77
|
+
}
|
|
78
|
+
};
|
|
74
79
|
const page = await browser.newPage();
|
|
75
80
|
testInfo.page = page;
|
|
76
81
|
try {
|
|
@@ -78,6 +83,7 @@ async function runServerAndTests(browser, isSecondAttempt) {
|
|
|
78
83
|
}
|
|
79
84
|
catch (err) {
|
|
80
85
|
logFailure(err, 'an error occurred while starting the server', isFinalAttempt);
|
|
86
|
+
abortMaybe();
|
|
81
87
|
return false;
|
|
82
88
|
}
|
|
83
89
|
let success = await runTests(testInfo, isFinalAttempt);
|
|
@@ -93,11 +99,12 @@ async function runServerAndTests(browser, isSecondAttempt) {
|
|
|
93
99
|
success = false;
|
|
94
100
|
}
|
|
95
101
|
}
|
|
96
|
-
if (!success && !testInfo.runInfo.isFlaky)
|
|
97
|
-
(0, parallel_ci_1.abortIfParallelCI)();
|
|
98
102
|
if (success) {
|
|
99
103
|
(0, logTestStatus_1.logPass)();
|
|
100
104
|
}
|
|
105
|
+
else {
|
|
106
|
+
abortMaybe();
|
|
107
|
+
}
|
|
101
108
|
Logs_1.Logs.clearLogs();
|
|
102
109
|
return success;
|
|
103
110
|
}
|