@brillout/test-e2e 0.1.7 → 0.1.8
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/getCurrentTest.d.ts +2 -2
- package/dist/runTests.js +4 -4
- package/dist/setup.d.ts +2 -2
- package/dist/setup.js +6 -6
- package/dist/utils/cliConfig.d.ts +1 -1
- package/dist/utils/cliConfig.js +1 -1
- package/package.json +1 -1
package/dist/getCurrentTest.d.ts
CHANGED
|
@@ -12,11 +12,11 @@ declare type TestInfo = {
|
|
|
12
12
|
runInfo?: {
|
|
13
13
|
cmd: string;
|
|
14
14
|
cwd: string;
|
|
15
|
-
|
|
15
|
+
testFunctionTimeout: number;
|
|
16
16
|
additionalTimeout: number;
|
|
17
17
|
serverIsReadyMessage?: string;
|
|
18
18
|
serverIsReadyDelay: number;
|
|
19
|
-
|
|
19
|
+
inspect: boolean;
|
|
20
20
|
};
|
|
21
21
|
hasStartedRunning?: boolean;
|
|
22
22
|
skipped?: string;
|
package/dist/runTests.js
CHANGED
|
@@ -45,7 +45,7 @@ async function runTests(browser) {
|
|
|
45
45
|
const done = (0, utils_1.logProgress)(`| [test] ${testDesc}`);
|
|
46
46
|
let err;
|
|
47
47
|
try {
|
|
48
|
-
await runTest(testFn, testInfo.runInfo.
|
|
48
|
+
await runTest(testFn, testInfo.runInfo.testFunctionTimeout);
|
|
49
49
|
}
|
|
50
50
|
catch (err_) {
|
|
51
51
|
err = err_;
|
|
@@ -75,7 +75,7 @@ async function runTests(browser) {
|
|
|
75
75
|
logTestsResult(true);
|
|
76
76
|
}
|
|
77
77
|
exports.runTests = runTests;
|
|
78
|
-
function runTest(testFn,
|
|
78
|
+
function runTest(testFn, testFunctionTimeout) {
|
|
79
79
|
let resolve;
|
|
80
80
|
let reject;
|
|
81
81
|
const promise = new Promise((resolve_, reject_) => {
|
|
@@ -83,8 +83,8 @@ function runTest(testFn, testTimeout) {
|
|
|
83
83
|
reject = reject_;
|
|
84
84
|
});
|
|
85
85
|
const timeout = setTimeout(() => {
|
|
86
|
-
reject(new Error(`[test] Timeout after ${(0, utils_1.humanizeTime)(
|
|
87
|
-
},
|
|
86
|
+
reject(new Error(`[test] Timeout after ${(0, utils_1.humanizeTime)(testFunctionTimeout)}`));
|
|
87
|
+
}, testFunctionTimeout);
|
|
88
88
|
const ret = testFn();
|
|
89
89
|
(async () => {
|
|
90
90
|
try {
|
package/dist/setup.d.ts
CHANGED
|
@@ -17,11 +17,11 @@ export declare let urlBase: string;
|
|
|
17
17
|
export declare const urlBaseChange: (url: string) => string;
|
|
18
18
|
export { editFile, editFileRevert } from './editFile';
|
|
19
19
|
declare function skip(reason: string): void;
|
|
20
|
-
declare function run(cmd: string, { additionalTimeout, serverIsReadyMessage, serverIsReadyDelay,
|
|
20
|
+
declare function run(cmd: string, { additionalTimeout, serverIsReadyMessage, serverIsReadyDelay, inspect, cwd, }?: {
|
|
21
21
|
additionalTimeout?: number;
|
|
22
22
|
serverIsReadyMessage?: string;
|
|
23
23
|
serverIsReadyDelay?: number;
|
|
24
|
-
|
|
24
|
+
inspect?: boolean;
|
|
25
25
|
cwd?: string;
|
|
26
26
|
}): void;
|
|
27
27
|
declare function autoRetry(test: () => void | Promise<void>, { timeout }?: {
|
package/dist/setup.js
CHANGED
|
@@ -26,10 +26,10 @@ var editFile_2 = require("./editFile");
|
|
|
26
26
|
Object.defineProperty(exports, "editFile", { enumerable: true, get: function () { return editFile_2.editFile; } });
|
|
27
27
|
Object.defineProperty(exports, "editFileRevert", { enumerable: true, get: function () { return editFile_2.editFileRevert; } });
|
|
28
28
|
const TIMEOUT_NPM_SCRIPT = 30 * 1000 * (!isGithubAction() ? 1 : isLinux() ? 1 : isWindows() ? 5 : 4);
|
|
29
|
-
const
|
|
29
|
+
const TIMEOUT_TEST_FUNCTION = 30 * 1000 * (!isGithubAction() ? 1 : isWindows() ? 10 : 6);
|
|
30
30
|
const TIMEOUT_AUTORETRY = 10 * 1000 * (!isGithubAction() || isLinux() ? 1 : 20); // TODO reduce `20`
|
|
31
31
|
const TIMEOUT_PROCESS_TERMINATION = 10 * 1000 * (!isGithubAction() ? 1 : isLinux() ? 1 : 4);
|
|
32
|
-
const TIMEOUT_PLAYWRIGHT =
|
|
32
|
+
const TIMEOUT_PLAYWRIGHT = 20 * 1000 * (!isGithubAction() ? 1 : isWindows() ? 5 : 4);
|
|
33
33
|
function skip(reason) {
|
|
34
34
|
const testInfo = (0, getCurrentTest_1.getCurrentTest)();
|
|
35
35
|
testInfo.skipped = reason;
|
|
@@ -37,19 +37,19 @@ function skip(reason) {
|
|
|
37
37
|
exports.skip = skip;
|
|
38
38
|
function run(cmd, {
|
|
39
39
|
//baseUrl = '',
|
|
40
|
-
additionalTimeout = 0, serverIsReadyMessage, serverIsReadyDelay = 1000,
|
|
40
|
+
additionalTimeout = 0, serverIsReadyMessage, serverIsReadyDelay = 1000, inspect = utils_1.cliConfig.inspect, cwd, } = {}) {
|
|
41
41
|
additionalTimeout += serverIsReadyDelay;
|
|
42
42
|
const testInfo = (0, getCurrentTest_1.getCurrentTest)();
|
|
43
43
|
testInfo.runInfo = {
|
|
44
44
|
cmd,
|
|
45
45
|
cwd: cwd || getCwd(),
|
|
46
46
|
additionalTimeout,
|
|
47
|
-
|
|
47
|
+
testFunctionTimeout: TIMEOUT_TEST_FUNCTION + additionalTimeout,
|
|
48
48
|
serverIsReadyMessage,
|
|
49
49
|
serverIsReadyDelay,
|
|
50
|
-
|
|
50
|
+
inspect,
|
|
51
51
|
};
|
|
52
|
-
if (
|
|
52
|
+
if (inspect) {
|
|
53
53
|
Logs_1.Logs.flushEagerly = true;
|
|
54
54
|
}
|
|
55
55
|
let runProcess = null;
|
package/dist/utils/cliConfig.js
CHANGED