fix: handle promise for reading protocol stream of trace (#6270)

This commit is contained in:
Christian Bromann
2020-07-23 16:21:15 +02:00
committed by GitHub
parent 15d1906e7c
commit 8c1a5866c5
2 changed files with 18 additions and 2 deletions

View File

@@ -118,4 +118,16 @@ describeChromeOnly('Tracing', function () {
const trace = await page.tracing.stop();
expect(trace.toString()).toContain('screenshot');
});
it('should properly fail if readProtocolStream errors out', async () => {
await page.tracing.start({ path: __dirname });
let error: Error = null;
try {
await page.tracing.stop();
} catch (error_) {
error = error_;
}
expect(error).toBeDefined();
});
});