()
| 170 | } |
| 171 | |
| 172 | async function skipChildMain() { |
| 173 | // Ensures the worker does not terminate too soon |
| 174 | parentPort.on('message', () => { }); |
| 175 | |
| 176 | const session = new Session(); |
| 177 | session.connectToMainThread(); |
| 178 | const notifications = []; |
| 179 | session.on('NodeWorker.attachedToWorker', (n) => notifications.push(n)); |
| 180 | await post(session, 'NodeWorker.enable', { waitForDebuggerOnStart: false }); |
| 181 | // 2 notifications mean there are 2 workers so we are connected to a main |
| 182 | // thread |
| 183 | assert.strictEqual(notifications.length, 2); |
| 184 | parentPort.postMessage('Ready'); |
| 185 | parentPort.postMessage({ messagesSent }); |
| 186 | parentPort.close(); |
| 187 | console.log('Skip child is done'); |
| 188 | } |
| 189 | |
| 190 | if (isMainThread) { |
| 191 | main().then(common.mustCall()); |
no test coverage detected
searching dependent graphs…