import Ajv from 'ajv';
import definitions from '../../../json-schemas/definitions.json' with { type: 'json' };
import { describe, expect, it } from 'bun:test';
describe('date-time schema', async () => {
    const ajv = new Ajv.default();
    const validateDateTime = ajv.compile(definitions.$defs['date-time']);
    it('should accept ISO 8601 date-time strings accepted by DWN', () => {
        expect(validateDateTime('2022-04-29T10:30:00.123456Z')).toBe(true);
    });
    it('should reject ISO 8601 date-time strings not accepted by DWN', () => {
        const unacceptableDateTimeStrings = [
            '2023-04-27T13:30:00.123456',
            '2023-04-27T13:30:00.123456z',
            '2023-04-27T13:30:00.1234Z',
            '2023-04-27T13:30:00Z',
            '2023-04-27T13:30:00.000000+00:00',
            '2023-04-27 13:30:00.000000Z'
        ];
        for (const dateTime of unacceptableDateTimeStrings) {
            expect(validateDateTime(dateTime)).toBe(false);
        }
    });
});
//# sourceMappingURL=definitions.spec.js.map