Skip to content

Commit c185f2d

Browse files
committed
test: indirect mock without reset
1 parent af348eb commit c185f2d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

test/core/test/do-mock-reset-modules.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ test('resetModules works with doMock for indirect actual module', async () => {
4444

4545
const { incrementIndirect: incrementWith20 } = await import('./fixtures/increment-indirect')
4646
expect(incrementWith20(1)).toBe(21)
47+
48+
vi.doMock('./fixtures/increment', () => ({
49+
increment: (num: number) => num + 30,
50+
}))
51+
52+
const { incrementIndirect: incrementWith20Still } = await import('./fixtures/increment-indirect')
53+
expect(incrementWith20Still(1)).toBe(21)
4754
})
4855

4956
test('resetModules works with doMock for direct virtual module', async () => {

0 commit comments

Comments
 (0)