@@ -909,6 +909,31 @@ namespace ts {
909909 const actual = ts . parseJsonConfigFileContent ( json , caseInsensitiveMixedExtensionHost , caseInsensitiveBasePath ) ;
910910 assertParsed ( actual , expected ) ;
911911 } ) ;
912+ it ( "with jsx=react-native, allowJs=false" , ( ) => {
913+ const json = {
914+ compilerOptions : {
915+ jsx : "react-native" ,
916+ allowJs : false
917+ }
918+ } ;
919+ const expected : ts . ParsedCommandLine = {
920+ options : {
921+ jsx : ts . JsxEmit . ReactNative ,
922+ allowJs : false
923+ } ,
924+ errors : [ ] ,
925+ fileNames : [
926+ "c:/dev/a.ts" ,
927+ "c:/dev/b.tsx" ,
928+ "c:/dev/c.tsx" ,
929+ ] ,
930+ wildcardDirectories : {
931+ "c:/dev" : ts . WatchDirectoryFlags . Recursive
932+ }
933+ } ;
934+ const actual = ts . parseJsonConfigFileContent ( json , caseInsensitiveMixedExtensionHost , caseInsensitiveBasePath ) ;
935+ assertParsed ( actual , expected ) ;
936+ } ) ;
912937 it ( "with jsx=none, allowJs=true" , ( ) => {
913938 const json = {
914939 compilerOptions : {
@@ -961,6 +986,33 @@ namespace ts {
961986 const actual = ts . parseJsonConfigFileContent ( json , caseInsensitiveMixedExtensionHost , caseInsensitiveBasePath ) ;
962987 assertParsed ( actual , expected ) ;
963988 } ) ;
989+ it ( "with jsx=react-native, allowJs=true" , ( ) => {
990+ const json = {
991+ compilerOptions : {
992+ jsx : "react-native" ,
993+ allowJs : true
994+ }
995+ } ;
996+ const expected : ts . ParsedCommandLine = {
997+ options : {
998+ jsx : ts . JsxEmit . ReactNative ,
999+ allowJs : true
1000+ } ,
1001+ errors : [ ] ,
1002+ fileNames : [
1003+ "c:/dev/a.ts" ,
1004+ "c:/dev/b.tsx" ,
1005+ "c:/dev/c.tsx" ,
1006+ "c:/dev/d.js" ,
1007+ "c:/dev/e.jsx" ,
1008+ ] ,
1009+ wildcardDirectories : {
1010+ "c:/dev" : ts . WatchDirectoryFlags . Recursive
1011+ }
1012+ } ;
1013+ const actual = ts . parseJsonConfigFileContent ( json , caseInsensitiveMixedExtensionHost , caseInsensitiveBasePath ) ;
1014+ assertParsed ( actual , expected ) ;
1015+ } ) ;
9641016 it ( "exclude .min.js files using wildcards" , ( ) => {
9651017 const json = {
9661018 compilerOptions : {
@@ -1306,4 +1358,4 @@ namespace ts {
13061358 } ) ;
13071359 } ) ;
13081360 } ) ;
1309- }
1361+ }
0 commit comments