(messageType: string, data: any)
| 269 | // Binary responses are wrapped in { done, content, status } by _handleLine. |
| 270 | // This helper unwraps them, matching how the Kotlin CoreMessenger reads responses. |
| 271 | async function request(messageType: string, data: any): Promise<any> { |
| 272 | const resp = await messenger.request(messageType as any, data); |
| 273 | return resp?.content !== undefined ? resp.content : resp; |
| 274 | } |
| 275 | |
| 276 | it("should respond to ping with pong", async () => { |
| 277 | const resp = await request("ping", "ping"); |