@brillout/test-e2e 0.5.2 → 0.5.3
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/Logs/isTolerateError.d.ts +7 -0
- package/dist/Logs/isTolerateError.js +32 -0
- package/dist/Logs.d.ts +1 -0
- package/dist/Logs.js +2 -11
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTolerateError = void 0;
|
|
4
|
+
const getConfig_1 = require("../getConfig");
|
|
5
|
+
function isTolerateError({ logSource, logText }) {
|
|
6
|
+
if (tolerateError({ logSource, logText })) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
const config = (0, getConfig_1.getConfig)();
|
|
10
|
+
if (!config.tolerateError) {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
return config.tolerateError({ logSource, logText });
|
|
14
|
+
}
|
|
15
|
+
exports.isTolerateError = isTolerateError;
|
|
16
|
+
function tolerateError({ logSource, logText }) {
|
|
17
|
+
return isFetchExperimentalWarning() && isTerminationEPIPE();
|
|
18
|
+
function isFetchExperimentalWarning() {
|
|
19
|
+
return (logSource === 'stderr' &&
|
|
20
|
+
logText.includes('ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time'));
|
|
21
|
+
}
|
|
22
|
+
/* Suppress:
|
|
23
|
+
```
|
|
24
|
+
[16:00:26.335][/examples/i18n-v1][npm run dev][run()] Terminate server.
|
|
25
|
+
[16:00:26.342][/examples/i18n-v1][npm run dev][stderr] The service was stopped: write EPIPE
|
|
26
|
+
[16:00:26.342][/examples/i18n-v1][npm run dev][run()] Process termination. (Nominal, exit code: null.)
|
|
27
|
+
```
|
|
28
|
+
*/
|
|
29
|
+
function isTerminationEPIPE() {
|
|
30
|
+
return logSource === 'stderr' && logText.includes('The service was stopped: write EPIPE');
|
|
31
|
+
}
|
|
32
|
+
}
|
package/dist/Logs.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export declare const Logs: {
|
|
|
7
7
|
hasFailLogs: typeof hasFailLogs;
|
|
8
8
|
logEagerly: boolean;
|
|
9
9
|
};
|
|
10
|
+
export type { LogSource };
|
|
10
11
|
declare type LogSource = 'stdout' | 'stderr' | 'Browser Error' | 'Browser Warning' | 'Browser Log' | 'Playwright' | 'run()' | 'run() failure' | 'test()' | 'Connection Error';
|
|
11
12
|
declare type LogEntry = {
|
|
12
13
|
logSource: LogSource;
|
package/dist/Logs.js
CHANGED
|
@@ -15,8 +15,8 @@ exports.Logs = {
|
|
|
15
15
|
const utils_1 = require("./utils");
|
|
16
16
|
const picocolors_1 = __importDefault(require("picocolors"));
|
|
17
17
|
const getCurrentTest_1 = require("./getCurrentTest");
|
|
18
|
-
const getConfig_1 = require("./getConfig");
|
|
19
18
|
const logSection_1 = require("./logSection");
|
|
19
|
+
const isTolerateError_1 = require("./Logs/isTolerateError");
|
|
20
20
|
let logEntries = [];
|
|
21
21
|
function hasFailLogs(failOnWarning) {
|
|
22
22
|
const failLogs = getErrorLogs(failOnWarning);
|
|
@@ -61,16 +61,7 @@ function flushLogs() {
|
|
|
61
61
|
}
|
|
62
62
|
function add({ logSource, logText, loggedAfterExit = false, }) {
|
|
63
63
|
const logTimestamp = getTimestamp();
|
|
64
|
-
const isNotFailure = ((
|
|
65
|
-
const config = (0, getConfig_1.getConfig)();
|
|
66
|
-
if (!config.tolerateError) {
|
|
67
|
-
return false;
|
|
68
|
-
}
|
|
69
|
-
return config.tolerateError({
|
|
70
|
-
logSource,
|
|
71
|
-
logText,
|
|
72
|
-
});
|
|
73
|
-
})();
|
|
64
|
+
const isNotFailure = (0, isTolerateError_1.isTolerateError)({ logSource, logText });
|
|
74
65
|
const logEntry = {
|
|
75
66
|
logSource,
|
|
76
67
|
logText,
|