()
| 78 | }, 0)); |
| 79 | |
| 80 | async function test() { |
| 81 | if (level < MAX_LEVEL) { |
| 82 | await createChildren(); |
| 83 | await createChildren(); |
| 84 | } |
| 85 | |
| 86 | channel.onmessage = function(message) { |
| 87 | switch (message.data) { |
| 88 | case 'start': |
| 89 | ping(); |
| 90 | break; |
| 91 | case 'end': |
| 92 | if (level === 0) { |
| 93 | completed.dec(); |
| 94 | } |
| 95 | break; |
| 96 | case 'exit': |
| 97 | channel.close(); |
| 98 | break; |
| 99 | } |
| 100 | }; |
| 101 | |
| 102 | if (level > 0) { |
| 103 | const currentThread = threadId - mainThread; |
| 104 | assert.strictEqual(level, (currentThread === 1 || currentThread === 4) ? 1 : 2); |
| 105 | parentPort.postMessage({ type: 'ready', threadId }); |
| 106 | } else { |
| 107 | channel.postMessage('start'); |
| 108 | ping(); |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | test(); |
no test coverage detected
searching dependent graphs…