mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: recover Buffer.concat on errors (#10252)
This commit is contained in:
parent
c9cca17833
commit
79b5299c5b
@ -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 () => {
|
||||
|
Loading…
Reference in New Issue
Block a user