From 9229e50ded60baf25db4393387c4d5290bdd2c5f Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Mon, 4 Nov 2024 15:24:13 -0800 Subject: [PATCH] test --- core/test/gather/driver/target-manager-test.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/core/test/gather/driver/target-manager-test.js b/core/test/gather/driver/target-manager-test.js index 3f5eb96d7dea..50699f794c52 100644 --- a/core/test/gather/driver/target-manager-test.js +++ b/core/test/gather/driver/target-manager-test.js @@ -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