Skip to content

Commit

Permalink
test: cors and rate limit plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Apr 12, 2022
1 parent dfae7fa commit 03d03cd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/Unit/IgniteTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,19 @@ describe('\n IgniteTest', () => {
expect(Config.get('app.name')).toBe('Athenna')
expect(Config.get('http.domain')).toBe('http://localhost:1335')

const { json, statusCode } = await httpServer.request({
const { json, statusCode, headers } = await httpServer.request({
method: 'GET',
url: '/healthcheck',
})

expect(statusCode).toBe(200)
expect(json()).toStrictEqual({ status: 'ok' })

expect(headers['access-control-expose-headers']).toBe('*')
expect(headers['x-ratelimit-limit']).toBe(1000)
expect(headers['x-ratelimit-remaining']).toBe(999)
expect(headers['x-ratelimit-reset']).toBe(60)

await application.shutdownHttpServer()
})

Expand Down

0 comments on commit 03d03cd

Please sign in to comment.