29 lines
864 B
TypeScript
29 lines
864 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { TaskSchema, HandoffSchema, DecisionSchema, MemorySchema, StatusSchema, ConfigSchema } from '../src/core/schema.js';
|
|
|
|
describe('schemas', () => {
|
|
it('validates a minimal task', () => {
|
|
const result = TaskSchema.safeParse({
|
|
id: 'TSK-0001',
|
|
title: 'Implement DNS cache',
|
|
description: 'Add local cache',
|
|
status: 'open',
|
|
createdAt: '2026-06-24T10:00:00Z',
|
|
updatedAt: '2026-06-24T10:00:00Z',
|
|
});
|
|
expect(result.success).toBe(true);
|
|
});
|
|
|
|
it('rejects an invalid task id', () => {
|
|
const result = TaskSchema.safeParse({
|
|
id: 'task-1',
|
|
title: 'Implement DNS cache',
|
|
description: '',
|
|
status: 'open',
|
|
createdAt: '2026-06-24T10:00:00Z',
|
|
updatedAt: '2026-06-24T10:00:00Z',
|
|
});
|
|
expect(result.success).toBe(false);
|
|
});
|
|
});
|