()
| 40 | // ws connection can be established before the orchestrator is fully loaded |
| 41 | // in very rare cases in the preview provider |
| 42 | function waitForOrchestrator() { |
| 43 | return new Promise<IframeOrchestrator>((resolve, reject) => { |
| 44 | const type = getBrowserState().type |
| 45 | if (type !== 'orchestrator') { |
| 46 | reject(new TypeError('Only orchestrator can create testers.')) |
| 47 | return |
| 48 | } |
| 49 | |
| 50 | function check() { |
| 51 | const orchestrator = getBrowserState().orchestrator |
| 52 | if (orchestrator) { |
| 53 | return resolve(orchestrator) |
| 54 | } |
| 55 | setTimeout(check) |
| 56 | } |
| 57 | check() |
| 58 | }) |
| 59 | } |
| 60 | |
| 61 | function createClient() { |
| 62 | const autoReconnect = true |
no test coverage detected