From 03d03cd8c56364c60e4738d5452fdd4b46060fb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Mon, 11 Apr 2022 21:27:08 -0300 Subject: [PATCH] test: cors and rate limit plugin --- tests/Unit/IgniteTest.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/Unit/IgniteTest.ts b/tests/Unit/IgniteTest.ts index 49e6ea3..2dd96a9 100644 --- a/tests/Unit/IgniteTest.ts +++ b/tests/Unit/IgniteTest.ts @@ -29,7 +29,7 @@ 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', }) @@ -37,6 +37,11 @@ describe('\n IgniteTest', () => { 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() })