Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sinclairzx81 committed Sep 26, 2023
1 parent 5ec6fc6 commit f351418
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
24 changes: 6 additions & 18 deletions test/runtime/compiler-ajv/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ describe('compiler-ajv/Array', () => {
it('Should correctly handle undefined array properties', () => {
const Answer = Type.Object({
text: Type.String(),
isCorrect: Type.Boolean(),
isCorrect: Type.Boolean()
})
const Question = Type.Object({
text: Type.String(),
Expand All @@ -160,27 +160,15 @@ describe('compiler-ajv/Array', () => {
maxContains: 1,
contains: Type.Object({
text: Type.String(),
isCorrect: Type.Literal(true),
}),
}),
isCorrect: Type.Literal(true)
})
})
})
Fail(Question, { text: 'A' })
Fail(Question, { text: 'A', options: [] })
Ok(Question, { text: 'A', options: [{ text: 'A', isCorrect: true }] })
Ok(Question, {
text: 'A',
options: [
{ text: 'A', isCorrect: true },
{ text: 'B', isCorrect: false },
],
})
Ok(Question, { text: 'A', options: [{ text: 'A', isCorrect: true }, { text: 'B', isCorrect: false }] })
Fail(Question, { text: 'A', options: [{ text: 'A', isCorrect: false }] })
Fail(Question, {
text: 'A',
options: [
{ text: 'A', isCorrect: true },
{ text: 'B', isCorrect: true },
],
})
Fail(Question, { text: 'A', options: [{ text: 'A', isCorrect: true }, { text: 'B', isCorrect: true }] })
})
})
1 change: 0 additions & 1 deletion test/runtime/compiler/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ describe('compiler/Array', () => {
// ----------------------------------------------------------------
// Issue: https://github.com/sinclairzx81/typebox/discussions/607
// ----------------------------------------------------------------
// prettier-ignore
it('Should correctly handle undefined array properties', () => {
const Answer = Type.Object({
text: Type.String(),
Expand Down
1 change: 0 additions & 1 deletion test/runtime/value/check/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ describe('value/check/Array', () => {
// ----------------------------------------------------------------
// Issue: https://github.com/sinclairzx81/typebox/discussions/607
// ----------------------------------------------------------------
// prettier-ignore
it('Should correctly handle undefined array properties', () => {
const Answer = Type.Object({
text: Type.String(),
Expand Down

0 comments on commit f351418

Please sign in to comment.