17 lines
592 B
TypeScript
17 lines
592 B
TypeScript
|
import { readSchema } from '../src/index';
|
||
|
|
||
|
describe('reader schema', () => {
|
||
|
it('complains about bad version', () => {
|
||
|
expect(() => readSchema('version 999 .')).toThrow(/Invalid Version/);
|
||
|
});
|
||
|
it('complains about missing version', () => {
|
||
|
expect(() => readSchema('')).toThrow(/missing version/);
|
||
|
});
|
||
|
it('is OK with an empty schema correctly versioned', () => {
|
||
|
const s = readSchema('version 1 .');
|
||
|
expect(s.version).toBeNull();
|
||
|
expect(s.definitions.size).toBe(0);
|
||
|
expect(s.embeddedType._variant).toBe('false');
|
||
|
});
|
||
|
});
|