mirror of
https://github.com/aaif-goose/goose.git
synced 2026-07-03 14:10:03 +02:00
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { getRecipeJsonSchema } from './validation';
|
|
|
|
describe('Recipe Validation', () => {
|
|
describe('getRecipeJsonSchema', () => {
|
|
it('returns a valid JSON schema object', () => {
|
|
const schema = getRecipeJsonSchema();
|
|
|
|
expect(schema).toBeDefined();
|
|
expect(typeof schema).toBe('object');
|
|
expect(schema).toHaveProperty('$schema');
|
|
expect(schema).toHaveProperty('type');
|
|
expect(schema).toHaveProperty('title');
|
|
expect(schema).toHaveProperty('description');
|
|
});
|
|
|
|
it('includes standard JSON Schema properties', () => {
|
|
const schema = getRecipeJsonSchema();
|
|
|
|
expect(schema.$schema).toBe('http://json-schema.org/draft-07/schema#');
|
|
expect(schema.title).toBeDefined();
|
|
expect(schema.description).toBeDefined();
|
|
});
|
|
|
|
it('returns consistent schema across calls', () => {
|
|
const schema1 = getRecipeJsonSchema();
|
|
const schema2 = getRecipeJsonSchema();
|
|
|
|
expect(schema1).toEqual(schema2);
|
|
});
|
|
});
|
|
});
|