fix(compiler-cli): do not emit invalid .metadata.json files
If no metadata is collected the `ngc` would generate file that contained `[null]` instead of eliding the `.metadata.json` file. Fixes: #20479
This commit is contained in:

committed by
Alex Rickabaugh

parent
e4c53f8529
commit
30208759cd
@ -1474,6 +1474,26 @@ describe('ngc transformer command-line', () => {
|
||||
});
|
||||
|
||||
describe('regressions', () => {
|
||||
//#20479
|
||||
it('should not generate an invalid metadata file', () => {
|
||||
write('src/tsconfig.json', `{
|
||||
"extends": "../tsconfig-base.json",
|
||||
"files": ["lib.ts"],
|
||||
"angularCompilerOptions": {
|
||||
"skipTemplateCodegen": true
|
||||
}
|
||||
}`);
|
||||
write('src/lib.ts', `
|
||||
export namespace A{
|
||||
export class C1 {
|
||||
}
|
||||
export interface I1{
|
||||
}
|
||||
}`);
|
||||
expect(main(['-p', path.join(basePath, 'src/tsconfig.json')])).toBe(0);
|
||||
shouldNotExist('src/lib.metadata.json');
|
||||
});
|
||||
|
||||
//#19544
|
||||
it('should recognize @NgModule() directive with a redundant @Injectable()', () => {
|
||||
write('src/tsconfig.json', `{
|
||||
|
Reference in New Issue
Block a user