| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							| 
									
										
										
										
											2020-05-19 12:08:49 -07:00
										 |  |  |  * Copyright Google LLC All Rights Reserved. | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  |  * | 
					
						
							|  |  |  |  * Use of this source code is governed by an MIT-style license that can be | 
					
						
							|  |  |  |  * found in the LICENSE file at https://angular.io/license
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const fs = require('fs'); | 
					
						
							|  |  |  | const PKG = 'angular/packages/compiler-cli/integrationtest/bazel/ng_module'; | 
					
						
							|  |  |  | describe('flat module index', () => { | 
					
						
							|  |  |  |   describe('child metadata', () => { | 
					
						
							|  |  |  |     it('should have contents', () => { | 
					
						
							|  |  |  |       const metadata = fs.readFileSync( | 
					
						
							| 
									
										
										
										
											2018-03-15 18:04:34 -07:00
										 |  |  |           require.resolve(`${PKG}/flat_module_filename.metadata.json`), {encoding: 'utf-8'}); | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  |       expect(metadata).toContain('"__symbolic":"module"'); | 
					
						
							|  |  |  |       expect(metadata).toContain('"__symbolic":"reference","module":"@angular/core"'); | 
					
						
							| 
									
										
										
										
											2018-03-26 14:34:44 -07:00
										 |  |  |       expect(metadata).toContain( | 
					
						
							|  |  |  |           '"origins":{"Child":"./child","ɵangular_packages_compiler_cli_integrationtest_bazel_ng_module_test_module_a":"./parent"}'); | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  |       expect(metadata).toContain('"importAs":"some_npm_module"'); | 
					
						
							|  |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  |   describe('child typings', () => { | 
					
						
							|  |  |  |     it('should have contents', () => { | 
					
						
							| 
									
										
										
										
											2018-03-15 18:04:34 -07:00
										 |  |  |       const dts = | 
					
						
							|  |  |  |           fs.readFileSync(require.resolve(`${PKG}/flat_module_filename.d.ts`), {encoding: 'utf-8'}); | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |       expect(dts).toContain('export * from \'./index\';'); | 
					
						
							| 
									
										
										
										
											2018-03-26 14:34:44 -07:00
										 |  |  |       expect(dts).toContain( | 
					
						
							|  |  |  |           'export { Parent as ɵangular_packages_compiler_cli_integrationtest_bazel_ng_module_test_module_a } from \'./parent\';'); | 
					
						
							| 
									
										
										
										
											2018-02-13 11:26:06 -08:00
										 |  |  |     }); | 
					
						
							|  |  |  |   }); | 
					
						
							| 
									
										
										
										
											2020-05-19 12:08:49 -07:00
										 |  |  | }); |