Skip to content

Commit

Permalink
fixup! refactor(ngcc): rework undecorated parent migration
Browse files Browse the repository at this point in the history
  • Loading branch information
JoostK committed Oct 23, 2019
1 parent 7960f91 commit 72b67d6
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,22 @@ runInEachFileSystem(() => {
const file = analysis.get(program.getSourceFile(INDEX_FILENAME) !) !;
expect(file.compiledClasses.find(c => c.name === 'DerivedClass')).toBeDefined();
expect(file.compiledClasses.find(c => c.name === 'RealBaseClass')).toBeUndefined();

const intermediateClass = file.compiledClasses.find(c => c.name === 'IntermediateClass') !;
expect(intermediateClass.decorators !.length).toEqual(1);
const intermediateDecorator = intermediateClass.decorators ![0];
expect(intermediateDecorator.name).toEqual('Directive');
expect(intermediateDecorator.identifier).toBeNull('The decorator must be synthesized');
expect(intermediateDecorator.import).toEqual({from: '@angular/core', name: 'Directive'});
expect(intermediateDecorator.args !.length).toEqual(0);

const baseClass = file.compiledClasses.find(c => c.name === 'BaseClass') !;
expect(baseClass.decorators !.length).toEqual(1);
const decorator = baseClass.decorators ![0];
expect(decorator.name).toEqual('Directive');
expect(decorator.identifier).toBeNull('The decorator must be synthesized');
expect(decorator.import).toEqual({from: '@angular/core', name: 'Directive'});
expect(decorator.args !.length).toEqual(0);
const baseDecorator = baseClass.decorators ![0];
expect(baseDecorator.name).toEqual('Directive');
expect(baseDecorator.identifier).toBeNull('The decorator must be synthesized');
expect(baseDecorator.import).toEqual({from: '@angular/core', name: 'Directive'});
expect(baseDecorator.args !.length).toEqual(0);
});

it('should handle the base class being in a different file (same package) as the derived class',
Expand Down

0 comments on commit 72b67d6

Please sign in to comment.