Files
elysia/test/core/compose.test.ts
2025-03-03 20:16:06 +07:00

15 lines
527 B
TypeScript

import { describe, expect, it } from 'bun:test'
import { Type } from '@sinclair/typebox'
import { hasAdditionalProperties } from '../../src/schema'
describe('hasAdditionalProperties', () => {
it('should handle object schemas without properties key', () => {
const schema = Type.Intersect([
Type.Object({ a: Type.String() }),
// Record schemas does not have properties key, instead it has patternProperties
Type.Record(Type.Number(), Type.String())
])
expect(hasAdditionalProperties(schema)).toBe(false)
})
})