From 8ced999e475934ea6aba2a59b2b233f79abd431c Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Tue, 22 Jan 2019 18:52:41 +0100 Subject: [PATCH] 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 --- .../compiler-cli/integrationtest/test/basic_spec.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/compiler-cli/integrationtest/test/basic_spec.ts b/packages/compiler-cli/integrationtest/test/basic_spec.ts index 370585521e..eebf199bb1 100644 --- a/packages/compiler-cli/integrationtest/test/basic_spec.ts +++ b/packages/compiler-cli/integrationtest/test/basic_spec.ts @@ -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', () => {