(r: RunningServer, cwd: string)
| 90 | } |
| 91 | |
| 92 | async function createSession(r: RunningServer, cwd: string): Promise<string> { |
| 93 | mkdirSync(cwd, { recursive: true }); |
| 94 | const res = await appOf(r).inject({ |
| 95 | method: 'POST', |
| 96 | url: '/api/v1/sessions', |
| 97 | payload: { metadata: { cwd } }, |
| 98 | }); |
| 99 | const env = envelopeOf<{ id: string }>(res.json()); |
| 100 | if (env.code !== 0 || env.data === null) { |
| 101 | throw new Error(`create session failed: ${JSON.stringify(env)}`); |
| 102 | } |
| 103 | return env.data.id; |
| 104 | } |
| 105 | |
| 106 | describe('terminal REST routes', () => { |
| 107 | it('creates terminals for multiple sessions using each session workspace cwd', async () => { |
no test coverage detected