@wdio/reporter
Advanced tools
Comparing version 9.0.0 to 9.0.4
@@ -157,2 +157,3 @@ // src/index.ts | ||
// src/utils.ts | ||
var FIRST_FUNCTION_REGEX = /function (\w+)/; | ||
function sanitizeString(str) { | ||
@@ -207,2 +208,21 @@ if (!str) { | ||
} | ||
function transformCommandScript(script) { | ||
if (!script) { | ||
return script; | ||
} | ||
let name = void 0; | ||
if (typeof script === "string") { | ||
name = FIRST_FUNCTION_REGEX.exec(script); | ||
FIRST_FUNCTION_REGEX.exec(""); | ||
} else if (typeof script === "function") { | ||
name = script.name; | ||
script = script.toString(); | ||
} else { | ||
return `<${typeof script}>`; | ||
} | ||
if (typeof name === "string" && name) { | ||
return `<script fn ${name}(...)> [${Buffer.byteLength(script, "utf-8")} bytes]`; | ||
} | ||
return `<script> [${Buffer.byteLength(script, "utf-8")} bytes]`; | ||
} | ||
@@ -595,2 +615,8 @@ // src/stats/runnable.ts | ||
} | ||
if (payload.body?.script) { | ||
payload.body = { | ||
...payload.body, | ||
script: transformCommandScript(payload.body.script) | ||
}; | ||
} | ||
currentTest.output.push(Object.assign(payload, { type: "command" })); | ||
@@ -606,2 +632,8 @@ } | ||
} | ||
if (payload.body?.script) { | ||
payload.body = { | ||
...payload.body, | ||
script: transformCommandScript(payload.body.script) | ||
}; | ||
} | ||
currentTest.output.push(Object.assign(payload, { type: "result" })); | ||
@@ -608,0 +640,0 @@ } |
@@ -44,2 +44,8 @@ import { COLORS } from './constants.js'; | ||
export declare function colorLines(name: keyof typeof COLORS, str: string): string; | ||
/** | ||
* Transforms WebDriver execute command scripts to avoid accumulating | ||
* long scripts in the default TestStats. | ||
* @param script WebDriver command script | ||
*/ | ||
export declare function transformCommandScript(script?: string | Function): string | undefined; | ||
//# sourceMappingURL=utils.d.ts.map |
{ | ||
"name": "@wdio/reporter", | ||
"version": "9.0.0", | ||
"version": "9.0.4", | ||
"description": "A WebdriverIO utility to help reporting all events", | ||
@@ -13,3 +13,3 @@ "author": "Christian Bromann <mail@bromann.dev>", | ||
"type": "git", | ||
"url": "git://github.com/webdriverio/webdriverio.git", | ||
"url": "git+https://github.com/webdriverio/webdriverio.git", | ||
"directory": "packages/wdio-reporter" | ||
@@ -42,4 +42,4 @@ }, | ||
"@types/node": "^20.1.0", | ||
"@wdio/logger": "9.0.0", | ||
"@wdio/types": "9.0.0", | ||
"@wdio/logger": "9.0.4", | ||
"@wdio/types": "9.0.4", | ||
"diff": "^5.0.0", | ||
@@ -55,3 +55,3 @@ "object-inspect": "^1.12.0" | ||
}, | ||
"gitHead": "957693463371a4cb329395dcdbce8fb0c930ab93" | ||
"gitHead": "1f3d6f781391548e8672e768e72b3d5c499a3aa7" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
76829
1885
0
+ Added@types/node@20.17.7(transitive)
+ Added@wdio/logger@9.0.4(transitive)
+ Added@wdio/types@9.0.4(transitive)
- Removed@types/node@20.17.9(transitive)
- Removed@wdio/logger@9.0.0(transitive)
- Removed@wdio/types@9.0.0(transitive)
Updated@wdio/logger@9.0.4
Updated@wdio/types@9.0.4