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