2017-05-11 13:26:02 -04: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 18:39:08 -04:00
|
|
|
it('should compile components with empty templates', () => {
|
|
|
|
const appDir = {
|
|
|
|
'app.module.ts': `
|
2017-05-11 13:26:02 -04:00
|
|
|
import { Component, NgModule } from '@angular/core';
|
|
|
|
|
|
|
|
@Component({template: ''})
|
|
|
|
export class EmptyComp {}
|
|
|
|
|
|
|
|
@NgModule({declarations: [EmptyComp]})
|
|
|
|
export class MyModule {}
|
|
|
|
`
|
2017-05-17 18:39:08 -04:00
|
|
|
};
|
|
|
|
const rootDir = {'app': appDir};
|
|
|
|
const {genFiles} = compile(
|
|
|
|
[rootDir, angularFiles], {postCompile: expectNoDiagnostics},
|
|
|
|
{noUnusedLocals: true, noUnusedParameters: true});
|
2017-10-10 16:45:42 -04:00
|
|
|
expect(genFiles.find((f) => f.genFileName === '/app/app.module.ngfactory.ts')).toBeTruthy();
|
2017-05-17 18:39:08 -04:00
|
|
|
});
|
2017-05-11 13:26:02 -04:00
|
|
|
});
|