Files
ai-safety-console-web/tests/unit/schemas/reports.test.ts
T
baozaotumao2025 1b90e552a5 first commit
2026-07-18 21:10:39 +08:00

26 lines
714 B
TypeScript

import { describe, expect, it } from 'vitest'
import { reportSchema } from '../../../src/schemas/reports'
describe('reportSchema', () => {
it('accepts the backend-defined arbitrary report summary', () => {
const result = reportSchema.parse({
run_id: 1,
summary: {
test_result: { passed: 8, failed: 2 },
admission: {
decision: 'NOT_EVALUATED',
coverage: { evaluated: 0, total: 10 },
evidence: ['retired'],
unmet_evidence: ['retired'],
},
missing_metrics: ['retired'],
},
})
expect(result.summary).toMatchObject({
test_result: { passed: 8, failed: 2 },
missing_metrics: ['retired'],
})
})
})