@@ -113,6 +113,38 @@ describe("getEmitPath", () => {
113113 expect ( fileNames ) . toHaveLength ( 1 ) ;
114114 expect ( fileNames ) . toContain ( path . join ( cwd , "out1" , "out2" , "bundle.lua" ) ) ;
115115 } ) ;
116+
117+ test . each ( [ ".scar" , "scar" ] ) ( "uses config extension (%p)" , extension => {
118+ const { transpiledFiles } = util . testModule ``
119+ . setMainFileName ( "main.ts" )
120+ . addExtraFile ( "dir/extra.ts" , "" )
121+ . setOptions ( { extension } )
122+ . expectToHaveNoDiagnostics ( )
123+ . getLuaResult ( ) ;
124+
125+ const fileNames = transpiledFiles . map ( f => f . outPath ) ;
126+ expect ( fileNames ) . toContain ( "main.scar" ) ;
127+ expect ( fileNames ) . toContain ( path . join ( "dir" , "extra.scar" ) ) ;
128+ } ) ;
129+
130+ test ( "bundle with different extension" , ( ) => {
131+ const { transpiledFiles } = util . testModule ``
132+ . setMainFileName ( "src/main.ts" )
133+ . addExtraFile ( "src/extra.ts" , "" )
134+ . setOptions ( {
135+ configFilePath,
136+ rootDir : "src" ,
137+ outDir : "out1" ,
138+ luaBundle : "out2/bundle.scar" ,
139+ luaBundleEntry : "src/main.ts" ,
140+ } )
141+ . expectToHaveNoDiagnostics ( )
142+ . getLuaResult ( ) ;
143+
144+ const fileNames = transpiledFiles . map ( f => f . outPath ) ;
145+ expect ( fileNames ) . toHaveLength ( 1 ) ;
146+ expect ( fileNames ) . toContain ( path . join ( cwd , "out1" , "out2" , "bundle.scar" ) ) ;
147+ } ) ;
116148} ) ;
117149
118150function normalize ( path : string ) {
0 commit comments