diff --git a/packages/platform-apple/src/runner/__tests__/runner-io.test.ts b/packages/platform-apple/src/runner/__tests__/runner-io.test.ts index 5d5529000a..e5c99e59c8 100644 --- a/packages/platform-apple/src/runner/__tests__/runner-io.test.ts +++ b/packages/platform-apple/src/runner/__tests__/runner-io.test.ts @@ -71,15 +71,21 @@ test('the tail follows a file its writer keeps appending to', async () => { test('a tail whose file disappears stops on its own instead of throwing', async () => { const logPath = logPathIn(); fs.writeFileSync(logPath, ''); - const tail = tailRunnerLogFile({ file: { logPath, startOffset: 0 }, onOutput: () => {} }); + const chunks: string[] = []; + const tail = tailRunnerLogFile({ + file: { logPath, startOffset: 0 }, + onOutput: (chunk) => chunks.push(chunk), + }); fs.rmSync(logPath); await new Promise((resolve) => setTimeout(resolve, 120)); + assert.deepEqual(chunks, []); // Writing a fresh file must not restart a tail that already gave up. fs.writeFileSync(logPath, 'AGENT_DEVICE_RUNNER_LISTENER_READY\n'); await new Promise((resolve) => setTimeout(resolve, 120)); tail.drain(); + assert.deepEqual(chunks, []); }); test('drain reads what the file gained and then stops following it', async () => { diff --git a/packages/platform-vega/src/inventory.test.ts b/packages/platform-vega/src/inventory.test.ts index e5941a3577..db77a1e997 100644 --- a/packages/platform-vega/src/inventory.test.ts +++ b/packages/platform-vega/src/inventory.test.ts @@ -5,7 +5,7 @@ import type { DeviceInventoryHostFor, PlatformRequestScope, } from '@agent-device/contracts/platform-runtime-host'; -import { createVegaInventory, parseVegaDeviceList } from './inventory.ts'; +import { createVegaInventory } from './inventory.ts'; const scope: PlatformRequestScope = { signal: new AbortController().signal, @@ -27,7 +27,19 @@ test('Vega inventory resolves the default CLI lazily and accepts only its virtua const devices = await createVegaInventory(host).discover({}, scope); - assert.deepEqual(devices, parseVegaDeviceList('VirtualDevice : tv\n')); + // Spelled out rather than compared against `parseVegaDeviceList(...)`: using the parser as the + // expected value lets both sides move together, which is exactly how a dropped `physical` row or + // a wrong `kind`/`booted` mapping would stay invisible. + assert.deepEqual(devices, [ + { + platform: 'vega', + id: 'VirtualDevice', + name: 'Vega Virtual Device (VirtualDevice)', + kind: 'emulator', + target: 'tv', + booted: true, + }, + ]); }); test('Vega inventory fails closed when only an unsupported physical target is present', async () => {