@@ -714,9 +714,9 @@ test("paths without baseUrl is error", () => {
714714test ( "module resolution using plugin" , ( ) => {
715715 const baseProjectPath = path . resolve ( __dirname , "module-resolution" , "project-with-module-resolution-plugin" ) ;
716716 const projectTsConfig = path . join ( baseProjectPath , "tsconfig.json" ) ;
717- const mainFile = path . join ( baseProjectPath , "src" , " main.ts") ;
717+ const mainFile = path . join ( baseProjectPath , "main.ts" ) ;
718718
719- const luaResult = util
719+ const testBuilder = util
720720 . testProject ( projectTsConfig )
721721 . setMainFileName ( mainFile )
722722 . setOptions ( {
@@ -726,19 +726,13 @@ test("module resolution using plugin", () => {
726726 } ,
727727 ] ,
728728 } )
729- . expectToHaveNoDiagnostics ( )
730- . getLuaResult ( ) ;
729+ . expectToHaveNoDiagnostics ( ) ;
731730
732- expect ( luaResult . transpiledFiles ) . toHaveLength ( 2 ) ;
733- let hasResolvedFile = false ;
734- for ( const f of luaResult . transpiledFiles ) {
735- hasResolvedFile = f . outPath . endsWith ( "bar.lua" ) ;
736- if ( hasResolvedFile ) {
737- break ;
738- }
739- }
731+ const luaResult = testBuilder . getLuaResult ( ) ;
732+
733+ expect ( luaResult . transpiledFiles ) . toHaveLength ( 3 ) ;
740734
741- expect ( hasResolvedFile ) . toBe ( true ) ;
735+ testBuilder . expectToEqual ( { result : [ "foo" , "absolutefoo" ] } ) ;
742736} ) ;
743737
744738function snapshotPaths ( files : tstl . TranspiledFile [ ] ) {
0 commit comments