Strip ansi from playwright logs to make them more readable
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/28860/head
parent
eaca3f83d6
commit
edefe02174
|
@ -275,6 +275,7 @@
|
|||
"rimraf": "^6.0.0",
|
||||
"semver": "^7.5.2",
|
||||
"source-map-loader": "^5.0.0",
|
||||
"strip-ansi": "^7.1.0",
|
||||
"stylelint": "^16.1.0",
|
||||
"stylelint-config-standard": "^36.0.0",
|
||||
"stylelint-scss": "^6.0.0",
|
||||
|
|
|
@ -7,6 +7,7 @@ Please see LICENSE files in the repository root for full details.
|
|||
|
||||
import { TestInfo } from "@playwright/test";
|
||||
import { Readable } from "stream";
|
||||
import stripAnsi from "strip-ansi";
|
||||
|
||||
export class ContainerLogger {
|
||||
private logs: Record<string, string> = {};
|
||||
|
@ -27,7 +28,7 @@ export class ContainerLogger {
|
|||
if (testInfo.status !== "passed") {
|
||||
for (const container in this.logs) {
|
||||
await testInfo.attach(container, {
|
||||
body: this.logs[container],
|
||||
body: stripAnsi(this.logs[container]),
|
||||
contentType: "text/plain",
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue