* refactor(core): provide error message in stack for reflective DI Fixes #16355 * fix(compiler): make AOT work with `noUnusedParameters` Fixes #15532 * refactor: use view engine also for `NgModuleFactory`s This is a prerequisite for being able to mock providers in AOTed code later on.
		
			
				
	
	
		
			37 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| /**
 | |
|  * @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 {async} from '@angular/core/testing';
 | |
| 
 | |
| import {MockDirectory, compile, expectNoDiagnostics, setup} from './test_util';
 | |
| 
 | |
| describe('regressions', () => {
 | |
|   let angularFiles = setup();
 | |
| 
 | |
|   it('should compile components with empty templates', async(() => {
 | |
|        const appDir = {
 | |
|          'app.module.ts': `
 | |
|         import { Component, NgModule } from '@angular/core';
 | |
| 
 | |
|         @Component({template: ''})
 | |
|         export class EmptyComp {}
 | |
| 
 | |
|         @NgModule({declarations: [EmptyComp]})
 | |
|         export class MyModule {}
 | |
|       `
 | |
|        };
 | |
|        const rootDir = {'app': appDir};
 | |
|        compile([rootDir, angularFiles], {postCompile: expectNoDiagnostics}, {
 | |
|          noUnusedLocals: true,
 | |
|          noUnusedParameters: true
 | |
|        }).then((result) => {
 | |
|          expect(result.genFiles.find((f) => f.genFileUrl === '/app/app.module.ngfactory.ts'))
 | |
|              .toBeTruthy();
 | |
|        });
 | |
|      }));
 | |
| });
 |