@@ -898,6 +898,33 @@ namespace ts {
898898 assert . deepEqual ( actual . wildcardDirectories , expected . wildcardDirectories ) ;
899899 assert . deepEqual ( actual . errors , expected . errors ) ;
900900 } ) ;
901+ it ( "with jsx=preserveWithJsExtension, allowJs=false" , ( ) => {
902+ const json = {
903+ compilerOptions : {
904+ jsx : "preserveWithJsExtension" ,
905+ allowJs : false
906+ }
907+ } ;
908+ const expected : ts . ParsedCommandLine = {
909+ options : {
910+ jsx : ts . JsxEmit . PreserveWithJsExtension ,
911+ allowJs : false
912+ } ,
913+ errors : [ ] ,
914+ fileNames : [
915+ "c:/dev/a.ts" ,
916+ "c:/dev/b.tsx" ,
917+ "c:/dev/c.tsx" ,
918+ ] ,
919+ wildcardDirectories : {
920+ "c:/dev" : ts . WatchDirectoryFlags . Recursive
921+ }
922+ } ;
923+ const actual = ts . parseJsonConfigFileContent ( json , caseInsensitiveMixedExtensionHost , caseInsensitiveBasePath ) ;
924+ assert . deepEqual ( actual . fileNames , expected . fileNames ) ;
925+ assert . deepEqual ( actual . wildcardDirectories , expected . wildcardDirectories ) ;
926+ assert . deepEqual ( actual . errors , expected . errors ) ;
927+ } ) ;
901928 it ( "with jsx=none, allowJs=true" , ( ) => {
902929 const json = {
903930 compilerOptions : {
@@ -954,6 +981,35 @@ namespace ts {
954981 assert . deepEqual ( actual . wildcardDirectories , expected . wildcardDirectories ) ;
955982 assert . deepEqual ( actual . errors , expected . errors ) ;
956983 } ) ;
984+ it ( "with jsx=preserveWithJsExtension, allowJs=true" , ( ) => {
985+ const json = {
986+ compilerOptions : {
987+ jsx : "preserveWithJsExtension" ,
988+ allowJs : true
989+ }
990+ } ;
991+ const expected : ts . ParsedCommandLine = {
992+ options : {
993+ jsx : ts . JsxEmit . PreserveWithJsExtension ,
994+ allowJs : true
995+ } ,
996+ errors : [ ] ,
997+ fileNames : [
998+ "c:/dev/a.ts" ,
999+ "c:/dev/b.tsx" ,
1000+ "c:/dev/c.tsx" ,
1001+ "c:/dev/d.js" ,
1002+ "c:/dev/e.jsx" ,
1003+ ] ,
1004+ wildcardDirectories : {
1005+ "c:/dev" : ts . WatchDirectoryFlags . Recursive
1006+ }
1007+ } ;
1008+ const actual = ts . parseJsonConfigFileContent ( json , caseInsensitiveMixedExtensionHost , caseInsensitiveBasePath ) ;
1009+ assert . deepEqual ( actual . fileNames , expected . fileNames ) ;
1010+ assert . deepEqual ( actual . wildcardDirectories , expected . wildcardDirectories ) ;
1011+ assert . deepEqual ( actual . errors , expected . errors ) ;
1012+ } ) ;
9571013 describe ( "with trailing recursive directory" , ( ) => {
9581014 it ( "in includes" , ( ) => {
9591015 const json = {
@@ -1149,4 +1205,4 @@ namespace ts {
11491205 } ) ;
11501206 } ) ;
11511207 } ) ;
1152- }
1208+ }
0 commit comments