From bb98e8b346c4bc3522358c673c6a008c7da67ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Garapich?= Date: Tue, 30 Jul 2024 08:59:34 +0000 Subject: [PATCH] test: fix test --- src/queue/map-pool/set.test.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/queue/map-pool/set.test.ts b/src/queue/map-pool/set.test.ts index 6330393c..349e077b 100644 --- a/src/queue/map-pool/set.test.ts +++ b/src/queue/map-pool/set.test.ts @@ -8,7 +8,7 @@ const events = vi.hoisted(() => { } }) -vi.mock('../../database/models/map-pool-entry.model', () => { +vi.mock('../../database/collections', () => { let maps: MapPoolEntry[] = [] return { collections: { @@ -17,7 +17,7 @@ vi.mock('../../database/models/map-pool-entry.model', () => { maps.length = 0 return Promise.resolve() }), - insertMany: vi.fn().mockImplementation(newMaps => { + insertMany: vi.fn().mockImplementation((newMaps: MapPoolEntry[]) => { maps = [...newMaps] return Promise.resolve() }), @@ -26,11 +26,13 @@ vi.mock('../../database/models/map-pool-entry.model', () => { }), }, }, - mapPoolSchema: { - parse: vi.fn(), - }, } }) +vi.mock('../../database/models/map-pool-entry.model', () => ({ + mapPoolSchema: { + parse: vi.fn(), + }, +})) vi.mock('../../events', () => ({ events })) describe('set()', () => {