This commit is contained in:
2025-09-19 00:40:19 -06:00
parent 75a9a44996
commit 8187a8f5ac
6 changed files with 170 additions and 6 deletions

View File

@@ -1,12 +1,10 @@
import { describe, it, expect } from 'vitest';
import Ajv, { type ErrorObject } from 'ajv';
import addFormats from 'ajv-formats';
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
// Implementation placeholder import; will fail until implemented per tasks T016, T018
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error - module not implemented yet
import { exportToJson } from '../../src/export';
const __filename = fileURLToPath(import.meta.url);
@@ -20,7 +18,8 @@ const schemaPath = path.join(
describe('Contract: export JSON schema (T009)', () => {
it('exportToJson() output should validate against export.schema.json', async () => {
const schemaJson = JSON.parse(fs.readFileSync(schemaPath, 'utf-8'));
const ajv = new Ajv({ allErrors: true, strict: true });
const ajv = new Ajv({ allErrors: true, strict: true });
addFormats(ajv);
const validate = ajv.compile(schemaJson);
// Minimal call; actual implementation will read from DB/models