File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -12,26 +12,27 @@ import {
1212 SpyInstance ,
1313 vi ,
1414} from "vitest" ;
15+ import * as tsnode from "ts-node" ;
16+
17+ import { TypeScriptLoader } from "./loader" ;
18+ import { TypeScriptCompileError } from "./typescript-compile-error" ;
1519
1620vi . mock ( "ts-node" , async ( ) => {
17- const tsnode = await vi . importActual < typeof import ( "ts-node" ) > ( "ts-node" ) ;
21+ const actualTsnode = await vi . importActual < typeof import ( "ts-node" ) > (
22+ "ts-node"
23+ ) ;
1824
19- let writableTsNode : any = { } ;
20- Object . keys ( tsnode ) . forEach ( ( key ) =>
25+ const writableTsNode : any = { } ;
26+ Object . keys ( actualTsnode ) . forEach ( ( key ) =>
2127 Object . defineProperty ( writableTsNode , key , {
22- value : ( tsnode as any ) [ key ] ,
28+ value : ( actualTsnode as any ) [ key ] ,
2329 writable : true ,
2430 } )
2531 ) ;
2632
2733 return writableTsNode ;
2834} ) ;
2935
30- import * as tsnode from "ts-node" ;
31-
32- import { TypeScriptLoader } from "./loader" ;
33- import { TypeScriptCompileError } from "./typescript-compile-error" ;
34-
3536describe ( "TypeScriptLoader" , ( ) => {
3637 const fixturesPath = path . resolve ( __dirname , "__fixtures__" ) ;
3738 const tsNodeSpy = vi . spyOn ( tsnode , "register" ) ;
You can’t perform that action at this time.
0 commit comments