build: improve compiler-cli codegen output test (#28191)

* Improves the `compiler-cli/integrationtest` codegen output test slightly by using a more clear test description and by adding an assertion that ensures that decorators are downleveled.

PR Close #28191
This commit is contained in:
Paul Gschwendtner 2019-01-22 18:52:41 +01:00 committed by Jason Aden
parent 4c8d17ffd4
commit 8ced999e47
1 changed files with 6 additions and 4 deletions

View File

@ -16,10 +16,12 @@ import {createComponent} from './util';
describe('template codegen output', () => {
const outDir = 'src';
it('should lower Decorators without reflect-metadata', () => {
const jsOutput = path.join(outDir, 'basic.js');
expect(fs.existsSync(jsOutput)).toBeTruthy();
expect(fs.readFileSync(jsOutput, {encoding: 'utf-8'})).not.toContain('Reflect.decorate');
it('should be able to lower annotations as static fields', () => {
const basicFilePath = path.join(outDir, 'basic.js');
expect(fs.existsSync(basicFilePath)).toBeTruthy();
const fileContent = fs.readFileSync(basicFilePath, 'utf8');
expect(fileContent).not.toContain('Reflect.decorate');
expect(fileContent).toContain('BasicComp.decorators = [');
});
it('should produce metadata.json outputs', () => {