Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(tele): don't spread buffer (#35632)

Simon Knott7c65d5e81ee5
diff --git a/packages/playwright/src/reporters/teleEmitter.ts b/packages/playwright/src/reporters/teleEmitter.ts
index 1e51dff309..2d00e3264a 100644
--- a/packages/playwright/src/reporters/teleEmitter.ts
+++ b/packages/playwright/src/reporters/teleEmitter.ts
@@ -243,10 +243,11 @@ export class TeleReporterEmitter implements ReporterV2 {
_serializeAttachments(attachments: reporterTypes.TestResult['attachments']): teleReceiver.JsonAttachment[] {
return attachments.map(a => {
+ const { body, ...rest } = a;
return {
- ...a,
+ ...rest,
// There is no Buffer in the browser, so there is no point in sending the data there.
- base64: (a.body && !this._emitterOptions.omitBuffers) ? a.body.toString('base64') : undefined,
+ base64: (body && !this._emitterOptions.omitBuffers) ? body.toString('base64') : undefined,
};
});
}