@wdio/utils
Advanced tools
Comparing version 5.14.3 to 5.14.4
@@ -44,3 +44,4 @@ "use strict"; | ||
}, cid, repeatTest = 0) { | ||
await (0, _errorHandler.logHookError)(`Before${type}`, (await executeHooksWithArgs(beforeFn, beforeFnArgs(this))), cid); | ||
const beforeArgs = mochaJasmineCompatibility(beforeFnArgs(this), this); | ||
await (0, _errorHandler.logHookError)(`Before${type}`, (await executeHooksWithArgs(beforeFn, beforeArgs)), cid); | ||
let promise; | ||
@@ -72,3 +73,4 @@ let result; | ||
}); | ||
afterArgs = mochaJasmineCompatibility(afterArgs, error, duration); | ||
afterArgs = mochaJasmineCompatibility(afterArgs, this); | ||
afterArgs = mochaJasmineResultCompatibility(afterArgs, error, duration); | ||
afterArgs = cucumberCompatibility(afterArgs); | ||
@@ -86,3 +88,15 @@ await (0, _errorHandler.logHookError)(`After${type}`, (await executeHooksWithArgs(afterFn, [...afterArgs])), cid); | ||
const mochaJasmineCompatibility = (afterArgs, error, duration) => { | ||
const mochaJasmineCompatibility = (hookArgs, { | ||
test = {} | ||
} = {}) => { | ||
let args = hookArgs; | ||
if (hookArgs.length < 4 && hookArgs[0] && typeof hookArgs[0] === 'object') { | ||
args[0].fullTitle = test.fullTitle ? test.fullTitle() : hookArgs[0].fullName ? hookArgs[0].fullName : undefined; | ||
} | ||
return args; | ||
}; | ||
const mochaJasmineResultCompatibility = (afterArgs, error, duration) => { | ||
let args = afterArgs; | ||
@@ -89,0 +103,0 @@ |
{ | ||
"name": "@wdio/utils", | ||
"version": "5.14.3", | ||
"version": "5.14.4", | ||
"description": "A WDIO helper utility to provide several utility functions used across the project.", | ||
@@ -40,3 +40,3 @@ "author": "Christian Bromann <christian@saucelabs.com>", | ||
}, | ||
"gitHead": "edce2a5ffcb3bbaf62ccebad4c482fe41f2a3077" | ||
"gitHead": "a61e97749a57e7b9e86864cbdf03456c71fd876a" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23657
645