From 9e2eb838e3adfbfeae6bbc4e4a9d522ff768b864 Mon Sep 17 00:00:00 2001 From: Wan <495709+wa0x6e@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:29:33 +0800 Subject: [PATCH] chore: fix failing tests (#248) --- test/e2e/votesReport.test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/e2e/votesReport.test.ts b/test/e2e/votesReport.test.ts index b78bc27..e3fcf8a 100644 --- a/test/e2e/votesReport.test.ts +++ b/test/e2e/votesReport.test.ts @@ -1,6 +1,6 @@ import request from 'supertest'; import VotesReport from '../../src/lib/votesReport'; -import { storageEngine } from '../../src/helpers/utils'; +import { storageEngine, sleep } from '../../src/helpers/utils'; import { rmSync } from 'fs'; const HOST = `http://localhost:${process.env.PORT || 3003}`; @@ -41,6 +41,7 @@ describe('GET /api/votes/:id', () => { const votesReport = new VotesReport(id, storage); expect(typeof (await votesReport.getCache())).not.toBe(false); + await sleep(parseInt(process.env.QUEUE_INTERVAL || '15e3')); }); });