import { describe, it, expect } from 'bun:test' import { readFileSync } from 'fs' import { join } from 'path' describe('run command result presentation', () => { const source = readFileSync(join(import.meta.dir, '../src/commands/run.ts'), 'utf-8') it('prefers WorkerResult.changed_files over recent filesystem scan', () => { expect(source).toContain('get_result_for_task') expect(source).toContain('workerResult?.changed_files') }) it('filters .air internals from produced files', () => { expect(source).toContain("file.startsWith('.air/')") expect(source).toContain("e.startsWith('.')") }) it('routes destructive confirmation before slash/main dispatch', () => { expect(source).toContain('pendingConfirmation') expect(source).toContain('handle_confirmation(true)') expect(source).toContain('handle_confirmation(false)') expect(source).toContain('No task was created') }) })