Skip to content

Commit

Permalink
chore: fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Nov 29, 2022
1 parent c9099b4 commit 4db7371
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/src/CDPSession.spec.ts
Expand Up @@ -59,12 +59,15 @@ describe('Target.createCDPSession', function () {
const {page, server} = getTestState();

const client = await page.target().createCDPSession();
await client.send('Network.enable');
const events = [];
await client.send('Network.enable');
client.on('Network.requestWillBeSent', event => {
return events.push(event);
});
await page.goto(server.EMPTY_PAGE);
await Promise.all([
waitEvent(client, 'Network.requestWillBeSent'),
page.goto(server.EMPTY_PAGE),
]);
expect(events.length).toBe(1);
});
it('should enable and disable domains independently', async () => {
Expand Down

0 comments on commit 4db7371

Please sign in to comment.