File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -228,7 +228,7 @@ import * as mod from './foobar.js'
228
228
vi .spyOn (mod , ' foo' )
229
229
vi .mock (' ./foobar.js' , async (importOriginal ) => {
230
230
return {
231
- ... await importOriginal (),
231
+ ... await importOriginal < typeof import ( ' ./foobar.js ' )> (),
232
232
// this will only affect "foo" outside of the original module
233
233
foo : () => ' mocked'
234
234
}
@@ -609,8 +609,8 @@ expect(obj.method).toHaveBeenCalled()
609
609
``` ts
610
610
import { mocked , original } from ' ./some-path.js'
611
611
612
- vi .mock (' ./some-path.js' , async () => {
613
- const mod = await vi . importActual <typeof import (' ./some-path.js' )>(' ./some-path.js ' )
612
+ vi .mock (' ./some-path.js' , async (importOriginal ) => {
613
+ const mod = await importOriginal <typeof import (' ./some-path.js' )>()
614
614
return {
615
615
... mod ,
616
616
mocked: vi .fn ()
You can’t perform that action at this time.
0 commit comments