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')); }); });