chore: recover Buffer.concat on errors (#10252)

This commit is contained in:
Alex Rudenko 2023-05-26 08:45:02 +02:00 committed by GitHub
parent c9cca17833
commit 79b5299c5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,13 +125,17 @@ describe('Tracing', function () {
await page.tracing.start({screenshots: true});
await page.goto(server.PREFIX + '/grid.html');
const oldBufferConcat = Buffer.concat;
Buffer.concat = () => {
throw 'error';
};
const trace = await page.tracing.stop();
expect(trace).toEqual(undefined);
Buffer.concat = oldBufferConcat;
try {
Buffer.concat = () => {
throw new Error('error');
};
const trace = await page.tracing.stop();
expect(trace).toEqual(undefined);
} finally {
Buffer.concat = oldBufferConcat;
}
});
it('should support a buffer without a path', async () => {