44namespace ts {
55 describe ( "convertTypeAcquisitionFromJson" , ( ) => {
66 function assertTypeAcquisition ( json : any , configFileName : string , expectedResult : { typeAcquisition : TypeAcquisition , errors : Diagnostic [ ] } ) {
7- const { options : actualTypeAcquisition , errors : actualErrors } = convertTypeAcquisitionFromJson ( json [ "typeAcquisition" ] , "/apath/" , configFileName ) ;
7+ const jsonOptions = json [ "typeAcquisition" ] || json [ "typingOptions" ] ;
8+ const { options : actualTypeAcquisition , errors : actualErrors } = convertTypeAcquisitionFromJson ( jsonOptions , "/apath/" , configFileName ) ;
89 const parsedTypeAcquisition = JSON . stringify ( actualTypeAcquisition ) ;
910 const expectedTypeAcquisition = JSON . stringify ( expectedResult . typeAcquisition ) ;
1011 assert . equal ( parsedTypeAcquisition , expectedTypeAcquisition ) ;
@@ -20,7 +21,29 @@ namespace ts {
2021 }
2122
2223 // tsconfig.json
23- it ( "Convert correctly format tsconfig.json to typing-options " , ( ) => {
24+ it ( "Convert deprecated typingOptions.enableAutoDiscovery format tsconfig.json to typeAcquisition " , ( ) => {
25+ assertTypeAcquisition (
26+ {
27+ "typingOptions" :
28+ {
29+ "enableAutoDiscovery" : true ,
30+ "include" : [ "0.d.ts" , "1.d.ts" ] ,
31+ "exclude" : [ "0.js" , "1.js" ]
32+ }
33+ } ,
34+ "tsconfig.json" ,
35+ {
36+ typeAcquisition :
37+ {
38+ enable : true ,
39+ include : [ "0.d.ts" , "1.d.ts" ] ,
40+ exclude : [ "0.js" , "1.js" ]
41+ } ,
42+ errors : < Diagnostic [ ] > [ ]
43+ } ) ;
44+ } ) ;
45+
46+ it ( "Convert correctly format tsconfig.json to typeAcquisition " , ( ) => {
2447 assertTypeAcquisition (
2548 {
2649 "typeAcquisition" :
@@ -42,7 +65,7 @@ namespace ts {
4265 } ) ;
4366 } ) ;
4467
45- it ( "Convert incorrect format tsconfig.json to typing-options " , ( ) => {
68+ it ( "Convert incorrect format tsconfig.json to typeAcquisition " , ( ) => {
4669 assertTypeAcquisition (
4770 {
4871 "typeAcquisition" :
@@ -70,7 +93,7 @@ namespace ts {
7093 } ) ;
7194 } ) ;
7295
73- it ( "Convert default tsconfig.json to typing-options " , ( ) => {
96+ it ( "Convert default tsconfig.json to typeAcquisition " , ( ) => {
7497 assertTypeAcquisition ( { } , "tsconfig.json" ,
7598 {
7699 typeAcquisition :
@@ -83,7 +106,7 @@ namespace ts {
83106 } ) ;
84107 } ) ;
85108
86- it ( "Convert tsconfig.json with only enable property to typing-options " , ( ) => {
109+ it ( "Convert tsconfig.json with only enable property to typeAcquisition " , ( ) => {
87110 assertTypeAcquisition (
88111 {
89112 "typeAcquisition" :
@@ -103,7 +126,7 @@ namespace ts {
103126 } ) ;
104127
105128 // jsconfig.json
106- it ( "Convert jsconfig.json to typing-options " , ( ) => {
129+ it ( "Convert jsconfig.json to typeAcquisition " , ( ) => {
107130 assertTypeAcquisition (
108131 {
109132 "typeAcquisition" :
@@ -124,7 +147,7 @@ namespace ts {
124147 } ) ;
125148 } ) ;
126149
127- it ( "Convert default jsconfig.json to typing-options " , ( ) => {
150+ it ( "Convert default jsconfig.json to typeAcquisition " , ( ) => {
128151 assertTypeAcquisition ( { } , "jsconfig.json" ,
129152 {
130153 typeAcquisition :
@@ -137,7 +160,7 @@ namespace ts {
137160 } ) ;
138161 } ) ;
139162
140- it ( "Convert incorrect format jsconfig.json to typing-options " , ( ) => {
163+ it ( "Convert incorrect format jsconfig.json to typeAcquisition " , ( ) => {
141164 assertTypeAcquisition (
142165 {
143166 "typeAcquisition" :
@@ -165,7 +188,7 @@ namespace ts {
165188 } ) ;
166189 } ) ;
167190
168- it ( "Convert jsconfig.json with only enable property to typing-options " , ( ) => {
191+ it ( "Convert jsconfig.json with only enable property to typeAcquisition " , ( ) => {
169192 assertTypeAcquisition (
170193 {
171194 "typeAcquisition" :
0 commit comments