|
1 | 1 | import { describe, expect, test } from 'vitest'; |
2 | | -import { recordCliOutput } from '../client-output.ts'; |
| 2 | +import { openCliOutput, recordCliOutput } from '../client-output.ts'; |
| 3 | + |
| 4 | +describe('openCliOutput', () => { |
| 5 | + test('prints session state directory on a second line', () => { |
| 6 | + const output = openCliOutput({ |
| 7 | + session: 'default', |
| 8 | + sessionStateDir: '/tmp/agent-device/sessions/cwd_123_default', |
| 9 | + identifiers: { session: 'default' }, |
| 10 | + }); |
| 11 | + |
| 12 | + expect(output.text).toBe( |
| 13 | + ['Opened: default', 'Session state: /tmp/agent-device/sessions/cwd_123_default'].join('\n'), |
| 14 | + ); |
| 15 | + expect(output.data).toMatchObject({ |
| 16 | + session: 'default', |
| 17 | + sessionStateDir: '/tmp/agent-device/sessions/cwd_123_default', |
| 18 | + }); |
| 19 | + }); |
| 20 | +}); |
3 | 21 |
|
4 | 22 | describe('recordCliOutput', () => { |
| 23 | + test('prints session state directory for record-created sessions', () => { |
| 24 | + const output = recordCliOutput({ |
| 25 | + recording: 'started', |
| 26 | + outPath: '/tmp/recording.mp4', |
| 27 | + sessionStateDir: '/tmp/agent-device/sessions/cwd_123_default', |
| 28 | + }); |
| 29 | + |
| 30 | + expect(output.text).toBe( |
| 31 | + ['/tmp/recording.mp4', 'Session state: /tmp/agent-device/sessions/cwd_123_default'].join( |
| 32 | + '\n', |
| 33 | + ), |
| 34 | + ); |
| 35 | + }); |
| 36 | + |
5 | 37 | test('prints chunked Android recording paths clearly for human stdout', () => { |
6 | 38 | const output = recordCliOutput({ |
7 | 39 | recording: 'stopped', |
|
0 commit comments