Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
adamraine committed Nov 4, 2024
1 parent 051385f commit 9229e50
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions core/test/gather/driver/target-manager-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,21 @@ describe('TargetManager', () => {
expect(sendMock.findAllInvocations('Runtime.runIfWaitingForDebugger')).toHaveLength(1);
});

it('should ignore errors if Target.getTargetInfo is undefined', async () => {
targetInfo.type = 'worker';
sendMock
.mockResponse('Target.getTargetInfo', () => {
throw new Error(`'Target.getTargetInfo' wasn't found`);
});
await targetManager.enable();

const invocations = sendMock.findAllInvocations('Target.setAutoAttach');
expect(invocations).toHaveLength(0);

// Should still be resumed.
expect(sendMock.findAllInvocations('Runtime.runIfWaitingForDebugger')).toHaveLength(1);
});

it('should ignore targets that are not frames or web workers', async () => {
targetInfo.type = 'service_worker';
sendMock
Expand Down

0 comments on commit 9229e50

Please sign in to comment.