@@ -104,35 +104,44 @@ describe('@angular/common ng_package', () => {
104104
105105
106106 describe ( 'should have module resolution properties in the package.json file for' , ( ) => {
107+ interface PackageJson {
108+ main : string ;
109+ es2015 : string ;
110+ module : string ;
111+ typings : string ;
112+ }
107113 // https://github.com/angular/common-builds/blob/master/package.json
108114 it ( '/' , ( ) => {
109- const actual = JSON . parse ( fs . readFileSync ( 'package.json' , { encoding : 'utf-8' } ) ) ;
115+ const actual = JSON . parse ( fs . readFileSync ( 'package.json' , { encoding : 'utf-8' } ) ) as PackageJson ;
110116 expect ( actual [ 'main' ] ) . toEqual ( './bundles/common.umd.js' ) ;
111117 } ) ;
112118 // https://github.com/angular/common-builds/blob/master/http/package.json
113119 it ( '/http' , ( ) => {
114- const actual = JSON . parse ( fs . readFileSync ( 'http/package.json' , { encoding : 'utf-8' } ) ) ;
120+ const actual = JSON . parse ( fs . readFileSync ( 'http/package.json' , { encoding : 'utf-8' } ) ) as PackageJson ;
115121 expect ( actual [ 'main' ] ) . toEqual ( '../bundles/common-http.umd.js' ) ;
116122 expect ( actual [ 'es2015' ] ) . toEqual ( '../fesm2015/http.js' ) ;
117123 expect ( actual [ 'module' ] ) . toEqual ( '../fesm2015/http.js' ) ;
118124 expect ( actual [ 'typings' ] ) . toEqual ( './http.d.ts' ) ;
119125 } ) ;
120126 // https://github.com/angular/common-builds/blob/master/testing/package.json
121127 it ( '/testing' , ( ) => {
122- const actual = JSON . parse ( fs . readFileSync ( 'testing/package.json' , { encoding : 'utf-8' } ) ) ;
128+ const actual =
129+ JSON . parse ( fs . readFileSync ( 'testing/package.json' , { encoding : 'utf-8' } ) ) as PackageJson ;
123130 expect ( actual [ 'main' ] ) . toEqual ( '../bundles/common-testing.umd.js' ) ;
124131 } ) ;
125132 // https://github.com/angular/common-builds/blob/master/http/testing/package.json
126133 it ( '/http/testing' , ( ) => {
127- const actual = JSON . parse ( fs . readFileSync ( 'http/testing/package.json' , { encoding : 'utf-8' } ) ) ;
134+ const actual =
135+ JSON . parse ( fs . readFileSync ( 'http/testing/package.json' , { encoding : 'utf-8' } ) ) as PackageJson ;
128136 expect ( actual [ 'main' ] ) . toEqual ( '../../bundles/common-http-testing.umd.js' ) ;
129137 expect ( actual [ 'es2015' ] ) . toEqual ( '../../fesm2015/http/testing.js' ) ;
130138 expect ( actual [ 'module' ] ) . toEqual ( '../../fesm2015/http/testing.js' ) ;
131139 expect ( actual [ 'typings' ] ) . toEqual ( './testing.d.ts' ) ;
132140 } ) ;
133141 // https://github.com/angular/common-builds/blob/master/upgrade/package.json
134142 it ( '/upgrade' , ( ) => {
135- const actual = JSON . parse ( fs . readFileSync ( 'upgrade/package.json' , { encoding : 'utf-8' } ) ) ;
143+ const actual =
144+ JSON . parse ( fs . readFileSync ( 'upgrade/package.json' , { encoding : 'utf-8' } ) ) as PackageJson ;
136145 expect ( actual [ 'main' ] ) . toEqual ( '../bundles/common-upgrade.umd.js' ) ;
137146 expect ( actual [ 'es2015' ] ) . toEqual ( '../fesm2015/upgrade.js' ) ;
138147 expect ( actual [ 'module' ] ) . toEqual ( '../fesm2015/upgrade.js' ) ;
0 commit comments