(r: RunningServer)
| 189 | const TINY_MP4 = Buffer.from('fake mp4 video data'); |
| 190 | |
| 191 | async function createSession(r: RunningServer): Promise<string> { |
| 192 | const res = await appOf(r).inject({ |
| 193 | method: 'POST', |
| 194 | url: '/api/v1/sessions', |
| 195 | payload: { metadata: { cwd: join(tmpDir, 'workspace') } }, |
| 196 | }); |
| 197 | const env = envelopeOf<{ id: string }>(res.json()); |
| 198 | if (env.code !== 0 || env.data === null) { |
| 199 | throw new Error(`create session failed: ${JSON.stringify(env)}`); |
| 200 | } |
| 201 | return env.data.id; |
| 202 | } |
| 203 | |
| 204 | /** |
| 205 | * Open a WS subscriber and wait for server_hello + client_hello ack. |
no test coverage detected