Skip to content

Commit

Permalink
test: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
garrappachc committed Jul 30, 2024
1 parent 58475be commit bb98e8b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/queue/map-pool/set.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand All @@ -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()
}),
Expand All @@ -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()', () => {
Expand Down

0 comments on commit bb98e8b

Please sign in to comment.