Skip to content

Commit

Permalink
Update list.test.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinmamaqi authored Dec 1, 2024
1 parent 005a8e7 commit 5658745
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions services/wiki/src/__tests__/itineraries/list.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { pathRoot } from '../../routes/routes'
import { ssoServer } from '../mocks/ssoServer'
import { itinerariesListSchema } from '../../schemas/itinerary/itinerariesListSchema'

const wait = async (int: number) => {
setTimeout(() => {}, int)
}
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))

Check failure on line 8 in services/wiki/src/__tests__/itineraries/list.test.ts

View workflow job for this annotation

GitHub Actions / pr_check_service_wiki

Return values from promise executor functions cannot be read

describe('Testing category GET method', () => {
it('Should respond OK status and return itineraries as an array. As per seed data, it should not be empty, and contain objects with an id and category name.', async () => {
Expand All @@ -31,8 +29,7 @@ describe('Testing category GET method', () => {
'Should fail and respond 503 status if ssoServer is not available',
async () => {
ssoServer.close()

await wait(500)
await wait(1000)
const response = await supertest(server).get(`${pathRoot.v1.itinerary}`)

expect(response.status).toBe(503)
Expand Down

0 comments on commit 5658745

Please sign in to comment.