| 
									
										
										
										
											2017-05-11 10:26:02 -07:00
										 |  |  | /** | 
					
						
							|  |  |  |  * @license | 
					
						
							|  |  |  |  * Copyright Google Inc. All Rights Reserved. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 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
 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import {MockDirectory, compile, expectNoDiagnostics, setup} from './test_util'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | describe('regressions', () => { | 
					
						
							|  |  |  |   let angularFiles = setup(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-17 15:39:08 -07:00
										 |  |  |   it('should compile components with empty templates', () => { | 
					
						
							|  |  |  |     const appDir = { | 
					
						
							|  |  |  |       'app.module.ts': `
 | 
					
						
							| 
									
										
										
										
											2017-05-11 10:26:02 -07:00
										 |  |  |         import { Component, NgModule } from '@angular/core'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         @Component({template: ''}) | 
					
						
							|  |  |  |         export class EmptyComp {} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         @NgModule({declarations: [EmptyComp]}) | 
					
						
							|  |  |  |         export class MyModule {} | 
					
						
							|  |  |  |       `
 | 
					
						
							| 
									
										
										
										
											2017-05-17 15:39:08 -07:00
										 |  |  |     }; | 
					
						
							|  |  |  |     const rootDir = {'app': appDir}; | 
					
						
							|  |  |  |     const {genFiles} = compile( | 
					
						
							|  |  |  |         [rootDir, angularFiles], {postCompile: expectNoDiagnostics}, | 
					
						
							|  |  |  |         {noUnusedLocals: true, noUnusedParameters: true}); | 
					
						
							| 
									
										
										
										
											2017-10-12 16:09:49 -07:00
										 |  |  |     expect(genFiles.find((f) => f.genFileUrl === '/app/app.module.ngfactory.ts')).toBeTruthy(); | 
					
						
							| 
									
										
										
										
											2017-05-17 15:39:08 -07:00
										 |  |  |   }); | 
					
						
							| 
									
										
										
										
											2017-05-11 10:26:02 -07:00
										 |  |  | }); |