diff --git a/tests/health.test.ts b/tests/health.test.ts index a096349..73ba5a5 100644 --- a/tests/health.test.ts +++ b/tests/health.test.ts @@ -4,10 +4,10 @@ test('healthy test', async ({ playwright }) => { const context = await playwright.request.newContext(); const response = await context.get('health'); await expect(response.status()).toBe(200); - await expect(response.headers()).toHaveProperty('healthy'); - await expect(response.headers()['healthy']).toBe('true'); + await expect(response.headers()).toHaveProperty('healthy'); + await expect(response.headers()['healthy']).toBe('true'); - const body = await response.json(); - await expect(body).toHaveProperty('status'); - await expect(body['status']).toBe('OK'); -}); \ No newline at end of file + const body = await response.json(); + await expect(body).toHaveProperty('status'); + await expect(body['status']).toBe('OK'); +}); diff --git a/tests/requestid.test.ts b/tests/requestid.test.ts index 1e12338..03fc5ac 100644 --- a/tests/requestid.test.ts +++ b/tests/requestid.test.ts @@ -2,36 +2,36 @@ import { expect, test } from '@playwright/test'; import { validate, NIL } from 'uuid'; import { requestIdHeader } from '$lib'; -test('response contains request-id header', async ({playwright}) => { +test('response contains request-id header', async ({ playwright }) => { const context = await playwright.request.newContext(); const response = await context.get('health'); - const headers = response.headers(); - await expect(headers).toHaveProperty(requestIdHeader); + const headers = response.headers(); + await expect(headers).toHaveProperty(requestIdHeader); }); -test('request-id is valid uuid', async ({playwright}) => { +test('request-id is valid uuid', async ({ playwright }) => { const context = await playwright.request.newContext(); const response = await context.get('health'); - const headers = response.headers(); - const requestId = headers[requestIdHeader]; - await expect(validate(requestId)).toBe(true); + const headers = response.headers(); + const requestId = headers[requestIdHeader]; + await expect(validate(requestId)).toBe(true); }); -test('reuse valid incoming uuid', async ({playwright}) => { +test('reuse valid incoming uuid', async ({ playwright }) => { const context = await playwright.request.newContext(); - const response = await context.get('health', { headers: { [requestIdHeader]: NIL }}); - const headers = response.headers(); - const requestId = headers[requestIdHeader]; - await expect(requestId).toBe(NIL); + const response = await context.get('health', { headers: { [requestIdHeader]: NIL } }); + const headers = response.headers(); + const requestId = headers[requestIdHeader]; + await expect(requestId).toBe(NIL); }); -test('ignore invalid incoming uuid', async ({playwright}) => { - const invalid = '00000000-0000-0000-0000-00000000000z'; +test('ignore invalid incoming uuid', async ({ playwright }) => { + const invalid = '00000000-0000-0000-0000-00000000000z'; const context = await playwright.request.newContext(); - const response = await context.get('health', { headers: { [requestIdHeader]: invalid }}); - const headers = response.headers(); - const requestId = headers[requestIdHeader]; - await expect(requestId).not.toBe(invalid); -}); \ No newline at end of file + const response = await context.get('health', { headers: { [requestIdHeader]: invalid } }); + const headers = response.headers(); + const requestId = headers[requestIdHeader]; + await expect(requestId).not.toBe(invalid); +});