(name)
| 21 | function createAgent(domain, calls, gates) { |
| 22 | const agent = new EventEmitter(); |
| 23 | const method = (name) => async () => { |
| 24 | calls.push(`${domain}.${name}`); |
| 25 | if (domain === 'Runtime' && name === 'runIfWaitingForDebugger') { |
| 26 | const gate = gates.shift(); |
| 27 | if (gate) { |
| 28 | await gate.promise; |
| 29 | } |
| 30 | } |
| 31 | }; |
| 32 | |
| 33 | agent.enable = method('enable'); |
| 34 | agent.setSamplingInterval = method('setSamplingInterval'); |
no test coverage detected