@wdio/utils 8.11.0 → 8.12.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testInterfaceWrapper.d.ts","sourceRoot":"","sources":["../../src/test-framework/testInterfaceWrapper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACR,UAAU,EAIV,aAAa,EAChB,MAAM,YAAY,CAAA;AAInB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,SACV,OAAO,UACL,QAAQ,UACR,QAAQ,YACN,QAAQ,GAAG,QAAQ,EAAE,gBACjB,WAAW,OAAO,CAAC,WACxB,QAAQ,GAAG,QAAQ,EAAE,eACjB,WAAW,OAAO,CAAC,OAC3B,MAAM,cACC,MAAM,WACT,MAAM,
|
|
1
|
+
{"version":3,"file":"testInterfaceWrapper.d.ts","sourceRoot":"","sources":["../../src/test-framework/testInterfaceWrapper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EACR,UAAU,EAIV,aAAa,EAChB,MAAM,YAAY,CAAA;AAInB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,OAAO,SACV,OAAO,UACL,QAAQ,UACR,QAAQ,YACN,QAAQ,GAAG,QAAQ,EAAE,gBACjB,WAAW,OAAO,CAAC,WACxB,QAAQ,GAAG,QAAQ,EAAE,eACjB,WAAW,OAAO,CAAC,OAC3B,MAAM,cACC,MAAM,WACT,MAAM,QAqClB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,SACV,OAAO,aACF,MAAM,UACT,QAAQ,UACR,QAAQ,YACN,QAAQ,GAAG,QAAQ,EAAE,gBACjB,WAAW,OAAO,CAAC,WACxB,QAAQ,GAAG,QAAQ,EAAE,eACjB,WAAW,OAAO,CAAC,OAC3B,MAAM,cACC,MAAM,WACT,MAAM,QAqClB,CAAA;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,SACnB,OAAO,UACL,QAAQ,UACR,OAAO,YACL,QAAQ,GAAG,QAAQ,EAAE,gBACjB,WAAW,OAAO,CAAC,WACxB,QAAQ,GAAG,QAAQ,EAAE,eACjB,WAAW,OAAO,CAAC,OAC3B,MAAM,wBAEwB,aAAa,QAkEnD,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,SACvB,OAAO,UACL,OAAO,YACL,QAAQ,GAAG,QAAQ,EAAE,gBACjB,WAAW,OAAO,CAAC,WACxB,QAAQ,GAAG,QAAQ,EAAE,eACjB,WAAW,OAAO,CAAC,UACxB,MAAM,OACT,MAAM,oCAcd,CAAA"}
|
|
@@ -22,7 +22,7 @@ const MOCHA_COMMANDS = ['skip', 'only'];
|
|
|
22
22
|
* @return {Function} wrapped framework hook function
|
|
23
23
|
*/
|
|
24
24
|
export const runHook = function (hookFn, origFn, beforeFn, beforeFnArgs, afterFn, afterFnArgs, cid, repeatTest, timeout) {
|
|
25
|
-
|
|
25
|
+
const wrappedHook = function (...hookFnArgs) {
|
|
26
26
|
return testFnWrapper.call(this, 'Hook', {
|
|
27
27
|
specFn: hookFn,
|
|
28
28
|
specFnArgs: filterSpecArgs(hookFnArgs)
|
|
@@ -33,7 +33,12 @@ export const runHook = function (hookFn, origFn, beforeFn, beforeFnArgs, afterFn
|
|
|
33
33
|
afterFn,
|
|
34
34
|
afterFnArgs
|
|
35
35
|
}, cid, repeatTest);
|
|
36
|
-
}
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* make sure Mocha grabs the correct hook function body
|
|
39
|
+
*/
|
|
40
|
+
wrappedHook.toString = () => hookFn.toString();
|
|
41
|
+
return origFn(wrappedHook, timeout);
|
|
37
42
|
};
|
|
38
43
|
/**
|
|
39
44
|
* runs a spec function (test function)
|
|
@@ -50,7 +55,7 @@ export const runHook = function (hookFn, origFn, beforeFn, beforeFnArgs, afterFn
|
|
|
50
55
|
* @return {Function} wrapped test function
|
|
51
56
|
*/
|
|
52
57
|
export const runSpec = function (specTitle, specFn, origFn, beforeFn, beforeFnArgs, afterFn, afterFnArgs, cid, repeatTest, timeout) {
|
|
53
|
-
|
|
58
|
+
const wrappedFn = function (...specFnArgs) {
|
|
54
59
|
return testFnWrapper.call(this, 'Test', {
|
|
55
60
|
specFn,
|
|
56
61
|
specFnArgs: filterSpecArgs(specFnArgs)
|
|
@@ -61,7 +66,12 @@ export const runSpec = function (specTitle, specFn, origFn, beforeFn, beforeFnAr
|
|
|
61
66
|
afterFn,
|
|
62
67
|
afterFnArgs
|
|
63
68
|
}, cid, repeatTest);
|
|
64
|
-
}
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* make sure Mocha grabs the correct test function body
|
|
72
|
+
*/
|
|
73
|
+
wrappedFn.toString = () => specFn.toString();
|
|
74
|
+
return origFn(specTitle, wrappedFn, timeout);
|
|
65
75
|
};
|
|
66
76
|
/**
|
|
67
77
|
* wraps hooks and test function of a framework within a fiber context
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/utils",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.12.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",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "be1e7959a7599e2afe33e60856be9a7ca16eb3aa"
|
|
42
42
|
}
|