()
| 105 | let lastExecutionId = 0 |
| 106 | |
| 107 | const spawn: SpawnFactory = () => { |
| 108 | const current = createBaseProc() |
| 109 | current.send = (message: unknown) => { |
| 110 | const msg = message as { type?: string; executionId?: number } |
| 111 | if (msg.type === 'execute') { |
| 112 | lastExecutionId = msg.executionId ?? 0 |
| 113 | markDispatched() |
| 114 | } |
| 115 | return true |
| 116 | } |
| 117 | setImmediate(() => current.emit('message', { type: 'ready' })) |
| 118 | proc = current |
| 119 | return current |
| 120 | } |
| 121 | |
| 122 | const release = (result: unknown = 'released') => { |
| 123 | proc?.emit('message', { |
no test coverage detected