mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-17 08:14:16 +00:00
- wrap adapter early-exit paths with a cleanup-aware exit helper - invoke cleanup before exiting on child spawn failures - validate Droid profile names in buildArgs and add unit coverage
18 lines
619 B
TypeScript
18 lines
619 B
TypeScript
/**
|
|
* Unit tests for Droid adapter argument building.
|
|
*/
|
|
import { describe, it, expect } from 'bun:test';
|
|
import { DroidAdapter } from '../../../src/targets/droid-adapter';
|
|
|
|
describe('DroidAdapter.buildArgs', () => {
|
|
it('builds droid model args for valid profile names', () => {
|
|
const adapter = new DroidAdapter();
|
|
expect(adapter.buildArgs('gemini_01', ['--help'])).toEqual(['-m', 'custom:ccs-gemini_01', '--help']);
|
|
});
|
|
|
|
it('rejects unsafe profile names', () => {
|
|
const adapter = new DroidAdapter();
|
|
expect(() => adapter.buildArgs('bad profile', [])).toThrow(/Invalid profile name/);
|
|
});
|
|
});
|