2017-05-11 13:26:02 -04:00
|
|
|
/**
|
|
|
|
* @license
|
2020-05-19 15:08:49 -04:00
|
|
|
* Copyright Google LLC All Rights Reserved.
|
2017-05-11 13:26:02 -04: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
|
|
|
|
*/
|
|
|
|
|
2020-04-08 13:14:18 -04:00
|
|
|
import {compile, expectNoDiagnostics, MockDirectory, setup} from './test_util';
|
2017-05-11 13:26:02 -04:00
|
|
|
|
|
|
|
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-12 19:09:49 -04:00
|
|
|
expect(genFiles.find((f) => f.genFileUrl === '/app/app.module.ngfactory.ts')).toBeTruthy();
|
2017-05-17 18:39:08 -04:00
|
|
|
});
|
2017-05-11 13:26:02 -04:00
|
|
|
});
|