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.tracing.start({screenshots: true});
|
||||||
await page.goto(server.PREFIX + '/grid.html');
|
await page.goto(server.PREFIX + '/grid.html');
|
||||||
|
|
||||||
const oldBufferConcat = Buffer.concat;
|
const oldBufferConcat = Buffer.concat;
|
||||||
Buffer.concat = () => {
|
try {
|
||||||
throw 'error';
|
Buffer.concat = () => {
|
||||||
};
|
throw new Error('error');
|
||||||
const trace = await page.tracing.stop();
|
};
|
||||||
expect(trace).toEqual(undefined);
|
const trace = await page.tracing.stop();
|
||||||
Buffer.concat = oldBufferConcat;
|
expect(trace).toEqual(undefined);
|
||||||
|
} finally {
|
||||||
|
Buffer.concat = oldBufferConcat;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should support a buffer without a path', async () => {
|
it('should support a buffer without a path', async () => {
|
||||||
|
Loading…
Reference in New Issue
Block a user