angular/packages/compiler/test/aot/regression_spec.ts
Tobias Bosch a22121d65d perf(compiler): skip type check and emit in bazel in some cases. (#19646)
If no user files changed:
- only type check the changed generated files

Never emit non changed generated files
- we still calculate them, but don’t send them through
  TypeScript to emit them but cache the written files instead.
PR Close #19646
2017-10-11 15:54:02 -07:00

33 lines
988 B
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 {MockDirectory, compile, expectNoDiagnostics, setup} from './test_util';
describe('regressions', () => {
let angularFiles = setup();
it('should compile components with empty templates', () => {
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};
const {genFiles} = compile(
[rootDir, angularFiles], {postCompile: expectNoDiagnostics},
{noUnusedLocals: true, noUnusedParameters: true});
expect(genFiles.find((f) => f.genFileName === '/app/app.module.ngfactory.ts')).toBeTruthy();
});
});