GenerateInput gains todayKst field. AiWorker computes KST-aligned date once per job, runs parseDueDate on rawText, calls provider.generate with todayKst, then merges: rule.iso wins if matched (deterministic), else AI's due_date, else null. Logs dueDateSource (rule|ai|none) for debugging. now() injection for testability. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import { describe, it, expect, beforeAll } from 'vitest';
|
|
import { LocalOllamaProvider } from '@main/ai/LocalOllamaProvider.js';
|
|
|
|
const skip = process.env.INKLING_INTEGRATION !== '1';
|
|
|
|
describe.skipIf(skip)('LocalOllamaProvider integration', () => {
|
|
const provider = new LocalOllamaProvider({
|
|
endpoint: process.env.INKLING_OLLAMA_ENDPOINT
|
|
});
|
|
|
|
beforeAll(async () => {
|
|
const h = await provider.healthCheck();
|
|
if (!h.ok) throw new Error(`Ollama not ready: ${h.reason}`);
|
|
});
|
|
|
|
const cases = [
|
|
'회의 중 A프로젝트 API 타임아웃 문제가 재발했다는 보고를 받음.',
|
|
'Stack trace: java.net.SocketTimeoutException at com.inkling.Api.call ... retried 3 times.',
|
|
'오늘 점심 김치찌개 맛있었음. 오후에 디자인 미팅 있다.'
|
|
];
|
|
|
|
it.each(cases)('Korean title + 3 lines for: %s', async (input) => {
|
|
const r = await provider.generate({ text: input, todayKst: '2026-04-26' });
|
|
expect(/[가-힣]/.test(r.title)).toBe(true);
|
|
expect(r.summary.split('\n')).toHaveLength(3);
|
|
for (const t of r.tags) expect(t).toMatch(/^[a-z0-9]+(-[a-z0-9]+)*$/);
|
|
}, 180_000);
|
|
});
|