@brillout/test-e2e 0.3.5 → 0.3.7
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/runTests.js +12 -4
- package/dist/setup.js +1 -1
- package/package.json +1 -1
package/dist/runTests.js
CHANGED
|
@@ -8,7 +8,6 @@ const getCurrentTest_1 = require("./getCurrentTest");
|
|
|
8
8
|
const Logs_1 = require("./Logs");
|
|
9
9
|
const utils_1 = require("./utils");
|
|
10
10
|
const picocolors_1 = __importDefault(require("picocolors"));
|
|
11
|
-
const logsContainError_errMsg = (isTermination) => [picocolors_1.default.bold('Encountered an error or warning'), !isTermination ? '' : ' during termination', ', see logs below.'].join('');
|
|
12
11
|
async function runTests(browser) {
|
|
13
12
|
const testInfo = (0, getCurrentTest_1.getCurrentTest)();
|
|
14
13
|
if (utils_1.isTTY) {
|
|
@@ -56,7 +55,8 @@ async function runTests(browser) {
|
|
|
56
55
|
}
|
|
57
56
|
done(!!err);
|
|
58
57
|
testInfo.afterEach(!!err);
|
|
59
|
-
const
|
|
58
|
+
const { doNotFailOnWarning } = testInfo.runInfo;
|
|
59
|
+
const hasErrorLog = Logs_1.Logs.hasErrorLogs(doNotFailOnWarning);
|
|
60
60
|
const isFailure = err || hasErrorLog;
|
|
61
61
|
if (isFailure) {
|
|
62
62
|
logTestsResult(false);
|
|
@@ -64,7 +64,7 @@ async function runTests(browser) {
|
|
|
64
64
|
console.error(err);
|
|
65
65
|
}
|
|
66
66
|
if (hasErrorLog) {
|
|
67
|
-
|
|
67
|
+
logIsFailure(false, !doNotFailOnWarning);
|
|
68
68
|
}
|
|
69
69
|
Logs_1.Logs.flushLogs();
|
|
70
70
|
process.exit(1);
|
|
@@ -82,7 +82,7 @@ async function runTests(browser) {
|
|
|
82
82
|
Logs_1.Logs.clearLogs();
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
|
-
|
|
85
|
+
logIsFailure(true, false);
|
|
86
86
|
Logs_1.Logs.flushLogs();
|
|
87
87
|
process.exit(1);
|
|
88
88
|
}
|
|
@@ -132,3 +132,11 @@ function logTestsResult(success) {
|
|
|
132
132
|
console.log(`${failStyle(' FAIL ')} ${testInfo.testFile}`);
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
+
function logIsFailure(isTermination, canBeAWarning) {
|
|
136
|
+
console.log(picocolors_1.default.red(picocolors_1.default.bold([
|
|
137
|
+
'Test FAIL because encountered an error',
|
|
138
|
+
!canBeAWarning ? '' : ' or warning',
|
|
139
|
+
!isTermination ? '' : ' during termination',
|
|
140
|
+
', see logs below.',
|
|
141
|
+
].join(''))));
|
|
142
|
+
}
|
package/dist/setup.js
CHANGED
|
@@ -24,7 +24,7 @@ Object.defineProperty(exports, "partRegex", { enumerable: true, get: function ()
|
|
|
24
24
|
var Logs_2 = require("./Logs");
|
|
25
25
|
Object.defineProperty(exports, "expectError", { enumerable: true, get: function () { return Logs_2.expectError; } });
|
|
26
26
|
const serverUrlDefault = 'http://localhost:3000';
|
|
27
|
-
const TIMEOUT_NPM_SCRIPT = 2 * 60 * 1000;
|
|
27
|
+
const TIMEOUT_NPM_SCRIPT = 2 * 60 * 1000 * (!(0, utils_1.isGithubAction)() ? 1 : (0, utils_1.isWindows)() ? 2 : 1);
|
|
28
28
|
const TIMEOUT_TEST_FUNCTION = 60 * 1000 * (!(0, utils_1.isGithubAction)() ? 1 : (0, utils_1.isWindows)() ? 5 : 3);
|
|
29
29
|
const TIMEOUT_PROCESS_TERMINATION = 10 * 1000 * (!(0, utils_1.isGithubAction)() ? 1 : (0, utils_1.isLinux)() ? 1 : 4);
|
|
30
30
|
const TIMEOUT_AUTORETRY = TIMEOUT_TEST_FUNCTION / 2;
|