690606:1705 ADR-035-135 #06
CI / CD Pipeline / build (push) Successful in 5m19s
CI / CD Pipeline / deploy (push) Successful in 3m11s

This commit is contained in:
2026-06-06 17:05:51 +07:00
parent 15dec6c3fc
commit 16aab2279c
15 changed files with 86 additions and 467 deletions
@@ -57,6 +57,19 @@ describe('OllamaService (ADR-034)', () => {
expect.anything()
);
});
it('ควรส่ง format=json เมื่อ caller ต้องการ structured output', async () => {
mockedAxios.post = jest
.fn()
.mockResolvedValueOnce({ data: { response: '{"ok":true}' } });
await service.generate('json prompt', {
format: 'json',
});
expect(mockedAxios.post).toHaveBeenCalledWith(
expect.stringContaining('/api/generate'),
expect.objectContaining({ format: 'json' }),
expect.anything()
);
});
it('ควรใช้ options.model เมื่อระบุ model อื่น (ADR-034 model switching)', async () => {
mockedAxios.post = jest
.fn()