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'
228228vi .spyOn (mod , ' foo' )
229229vi .mock (' ./foobar.js' , async (importOriginal ) => {
230230 return {
231- ... await importOriginal (),
231+ ... await importOriginal < typeof import ( ' ./foobar.js ' )> (),
232232 // this will only affect "foo" outside of the original module
233233 foo : () => ' mocked'
234234 }
@@ -609,8 +609,8 @@ expect(obj.method).toHaveBeenCalled()
609609``` ts
610610import { mocked , original } from ' ./some-path.js'
611611
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' )>()
614614 return {
615615 ... mod ,
616616 mocked: vi .fn ()
You can’t perform that action at this time.
0 commit comments