@wdio/utils 7.19.0 → 7.19.1
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.
|
@@ -24,4 +24,10 @@ export declare const testFnWrapper: (this: unknown, args_0: string, args_1: Spec
|
|
|
24
24
|
* @return {*} specFn result
|
|
25
25
|
*/
|
|
26
26
|
export declare const testFrameworkFnWrapper: (this: unknown, { executeHooksWithArgs, executeAsync, runSync }: WrapperMethods, type: string, { specFn, specFnArgs }: SpecFunction, { beforeFn, beforeFnArgs }: BeforeHookParam<unknown>, { afterFn, afterFnArgs }: AfterHookParam<unknown>, cid: string, repeatTest?: number) => Promise<unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Filter out internal stacktraces. exporting to allow testing of the function
|
|
29
|
+
* @param {string} stack Stacktrace
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
export declare const filterStackTrace: (stack: string) => string;
|
|
27
33
|
//# sourceMappingURL=testFnWrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testFnWrapper.d.ts","sourceRoot":"","sources":["../../src/test-framework/testFnWrapper.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,cAAc,EACd,YAAY,EACZ,eAAe,EACf,cAAc,EAEjB,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"testFnWrapper.d.ts","sourceRoot":"","sources":["../../src/test-framework/testFnWrapper.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACR,cAAc,EACd,YAAY,EACZ,eAAe,EACf,cAAc,EAEjB,MAAM,SAAS,CAAA;AAShB;;;;;;;;;;GAUG;AACH,eAAO,MAAM,aAAa,SAChB,OAAO,8JAWhB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,SACzB,OAAO,mDACoC,cAAc,QACzD,MAAM,0BACY,YAAY,8BACR,gBAAgB,OAAO,CAAC,4BAC1B,eAAe,OAAO,CAAC,OAC5C,MAAM,0CAuDd,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,UAAW,MAAM,KAAG,MAKhD,CAAA"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.testFrameworkFnWrapper = exports.testFnWrapper = void 0;
|
|
3
|
+
exports.filterStackTrace = exports.testFrameworkFnWrapper = exports.testFnWrapper = void 0;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
5
|
const errorHandler_1 = require("./errorHandler");
|
|
6
6
|
const shim_1 = require("../shim");
|
|
7
|
+
const STACKTRACE_FILTER = [
|
|
8
|
+
'node_modules/webdriver/',
|
|
9
|
+
'node_modules/webdriverio/',
|
|
10
|
+
'node_modules/@wdio/',
|
|
11
|
+
'(internal/process/task',
|
|
12
|
+
];
|
|
7
13
|
/**
|
|
8
14
|
* wraps test framework spec/hook function with WebdriverIO before/after hooks
|
|
9
15
|
*
|
|
@@ -52,6 +58,9 @@ const testFrameworkFnWrapper = async function ({ executeHooksWithArgs, executeAs
|
|
|
52
58
|
result = await promise;
|
|
53
59
|
}
|
|
54
60
|
catch (err) {
|
|
61
|
+
if (err.stack) {
|
|
62
|
+
err.stack = (0, exports.filterStackTrace)(err.stack);
|
|
63
|
+
}
|
|
55
64
|
error = err;
|
|
56
65
|
}
|
|
57
66
|
const duration = Date.now() - testStart;
|
|
@@ -78,3 +87,15 @@ const testFrameworkFnWrapper = async function ({ executeHooksWithArgs, executeAs
|
|
|
78
87
|
return result;
|
|
79
88
|
};
|
|
80
89
|
exports.testFrameworkFnWrapper = testFrameworkFnWrapper;
|
|
90
|
+
/**
|
|
91
|
+
* Filter out internal stacktraces. exporting to allow testing of the function
|
|
92
|
+
* @param {string} stack Stacktrace
|
|
93
|
+
* @returns {string}
|
|
94
|
+
*/
|
|
95
|
+
const filterStackTrace = (stack) => {
|
|
96
|
+
return stack
|
|
97
|
+
.split('\n')
|
|
98
|
+
.filter(line => !STACKTRACE_FILTER.some(l => line.includes(l)))
|
|
99
|
+
.join('\n');
|
|
100
|
+
};
|
|
101
|
+
exports.filterStackTrace = filterStackTrace;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "7.19.
|
|
3
|
+
"version": "7.19.1",
|
|
4
4
|
"description": "A WDIO helper utility to provide several utility functions used across the project.",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-utils",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@wdio/logger": "7.19.0",
|
|
27
|
-
"@wdio/types": "7.19.
|
|
27
|
+
"@wdio/types": "7.19.1",
|
|
28
28
|
"p-iteration": "^1.1.8"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
33
|
"types": "./build/index.d.ts",
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "11be174dbad723750c8ab3fc9bc197f2f3534d1c"
|
|
35
35
|
}
|