()
| 1 | 'use strict'; |
| 2 | |
| 3 | export function patchMessageChannel() { |
| 4 | global.MessageChannel = class { |
| 5 | constructor() { |
| 6 | const port1 = { |
| 7 | onmesssage: () => {}, |
| 8 | }; |
| 9 | |
| 10 | this.port1 = port1; |
| 11 | |
| 12 | this.port2 = { |
| 13 | postMessage(msg) { |
| 14 | setTimeout(() => { |
| 15 | port1.onmessage(msg); |
| 16 | }, 0); |
| 17 | }, |
| 18 | }; |
| 19 | } |
| 20 | }; |
| 21 | } |
no outgoing calls
no test coverage detected