@@ -68,13 +68,13 @@ describe('arrays', () => {
6868
6969 it ( 'duplicate maps should be removed from arrays' , ( ) => {
7070 expect ( convertTokenToTypeScript ( tokenize ( [ { key : 'mads' } , { key : 'was' } , { key : 'here' } ] ) ) ) . toEqual (
71- 'Array<{ key: string }>'
71+ 'Array<{ " key" : string }>'
7272 ) ;
7373 } ) ;
7474
7575 it ( 'maps should be able to be mixed in arrays' , ( ) => {
7676 expect ( convertTokenToTypeScript ( tokenize ( [ { key : 1.23 } , { key : 'mads' } , { key : 1 } ] ) ) ) . toEqual (
77- 'Array<{ key: number } | { key: string }>'
77+ 'Array<{ " key" : number } | { " key" : string }>'
7878 ) ;
7979 } ) ;
8080} ) ;
@@ -85,7 +85,7 @@ describe('maps', () => {
8585 } ) ;
8686
8787 it ( 'maps should support primitive value children' , ( ) => {
88- expect ( convertTokenToTypeScript ( tokenize ( { key : 'value' } ) ) ) . toEqual ( '{ key: string }' ) ;
88+ expect ( convertTokenToTypeScript ( tokenize ( { key : 'value' } ) ) ) . toEqual ( '{ " key" : string }' ) ;
8989
9090 expect (
9191 convertTokenToTypeScript (
@@ -97,7 +97,9 @@ describe('maps', () => {
9797 falseKey : false ,
9898 } )
9999 )
100- ) . toEqual ( '{ falseKey: boolean; nullKey: null; numberKey: number; stringKey: string; trueKey: boolean }' ) ;
100+ ) . toEqual (
101+ '{ "falseKey": boolean; "nullKey": null; "numberKey": number; "stringKey": string; "trueKey": boolean }'
102+ ) ;
101103 } ) ;
102104
103105 it ( 'maps should be able to be nested' , ( ) => {
@@ -115,11 +117,11 @@ describe('maps', () => {
115117 } ,
116118 } )
117119 )
118- ) . toEqual ( '{ a : { b : { c : { d : { key: string } } } } }' ) ;
120+ ) . toEqual ( '{ "a" : { "b" : { "c" : { "d" : { " key" : string } } } } }' ) ;
119121 } ) ;
120122
121123 it ( 'it should be possible to mix map with arrays' , ( ) => {
122- expect ( convertTokenToTypeScript ( tokenize ( { arr : [ 1.23 ] } ) ) ) . toEqual ( '{ arr: Array<number> }' ) ;
124+ expect ( convertTokenToTypeScript ( tokenize ( { arr : [ 1.23 ] } ) ) ) . toEqual ( '{ " arr" : Array<number> }' ) ;
123125 } ) ;
124126
125127 it ( 'maps should be sorted automatically' , ( ) => {
@@ -182,7 +184,7 @@ describe('json2ts', async () => {
182184 }` ;
183185
184186 const expectedResult =
185- 'type GeneratedStruct = { printWidth: number; semi: boolean; singleQuote: boolean; tabWidth: number; useTabs: boolean }' ;
187+ 'type GeneratedStruct = { " printWidth" : number; " semi" : boolean; " singleQuote" : boolean; " tabWidth" : number; " useTabs" : boolean }' ;
186188
187189 expect ( generateTypeScriptType ( tokenize ( JSON . parse ( jsonStr ) ) ) ) . toEqual ( expectedResult ) ;
188190 } ) ;
@@ -200,7 +202,7 @@ describe('json2ts', async () => {
200202 }` ;
201203
202204 const expectedResult =
203- 'type GeneratedStruct = { data: Array<{ length: number; message: string; retry_after: number }> }' ;
205+ 'type GeneratedStruct = { " data" : Array<{ " length" : number; " message" : string; " retry_after" : number }> }' ;
204206
205207 expect ( generateTypeScriptType ( tokenize ( JSON . parse ( jsonStr ) ) ) ) . toEqual ( expectedResult ) ;
206208 } ) ;
0 commit comments