Skip to content

Commit

Permalink
fix(validator): resolve test failures
Browse files Browse the repository at this point in the history
  • Loading branch information
naorpeled committed Jun 6, 2024
1 parent e1f5500 commit 27c17da
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions packages/validator/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,19 +246,24 @@ test('It should validate an event object with formats', async (t) => {
}
}

const body = await handler(event, context)
try {
const body = await handler(event, context)

t.deepEqual(body, {
date: '2000-01-01',
time: '00:00:00',
'date-time': '2000-01-01T00:00:00',
uri: 'https://example.org',
email: 'username@example.org',
hostname: 'sub.example.org',
ipv4: '127.0.0.1',
ipv6: '2001:0db8:0000:0000:0000:ff00:0042:8329',
uuid: '123e4567-e89b-12d3-a456-426614174000'
})
t.deepEqual(body, {
date: '2000-01-01',
time: '00:00:00',
'date-time': '2000-01-01T00:00:00',
uri: 'https://example.org',
email: 'username@example.org',
hostname: 'sub.example.org',
ipv4: '127.0.0.1',
ipv6: '2001:0db8:0000:0000:0000:ff00:0042:8329',
uuid: '123e4567-e89b-12d3-a456-426614174000'
})
} catch (e) {
console.log('_____E', JSON.stringify(e, null, 2))
t.fail(e)
}
})

test('It should handle invalid schema as a BadRequest', async (t) => {
Expand Down

0 comments on commit 27c17da

Please sign in to comment.