19 lines
794 B
TypeScript
19 lines
794 B
TypeScript
import { describe, expect, it } from 'vitest';
|
||
import { bundleConfigSchema } from '../src/bundle.js';
|
||
|
||
describe('the agent configuration’s model', () => {
|
||
it('preserves legacy model names when reading stored bundles', () => {
|
||
expect(bundleConfigSchema.parse({ schemaVersion: 1, prompts: {}, model: 'deepseek-pro@latest[1m]' }).model).toBe(
|
||
'deepseek-pro@latest[1m]',
|
||
);
|
||
});
|
||
|
||
it('may be a model gateway’s name, never an argument', () => {
|
||
expect(bundleConfigSchema.parse({ schemaVersion: 1, prompts: {}, model: 'deepseek-pro@latest' }).model).toBe(
|
||
'deepseek-pro@latest',
|
||
);
|
||
for (const model of ['-p', '--model', 'a b', '$(id)'])
|
||
expect(bundleConfigSchema.safeParse({ schemaVersion: 1, prompts: {}, model }).success, model).toBe(false);
|
||
});
|
||
});
|