| 24 | } |
| 25 | |
| 26 | async function assertTargetAttachedState(session, targetId, attached) { |
| 27 | const { targetInfos } = await session.send({ method: 'Target.getTargets' }); |
| 28 | const targetInfo = targetInfos.find((target) => { |
| 29 | return target.targetId === targetId; |
| 30 | }); |
| 31 | assert.notStrictEqual(targetInfo, undefined); |
| 32 | assert.strictEqual(targetInfo.attached, attached); |
| 33 | } |
| 34 | |
| 35 | async function test(isSetAutoAttachBeforeExecution) { |
| 36 | const child = new NodeInstance(['--inspect-brk=0', '--experimental-worker-inspection'], |