From 03fef736d60599e8046342c5ee4e503001c8e08f Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 19 May 2020 08:29:36 +0100 Subject: [PATCH] test(ngcc): give adjacent class identifier a distinct name (#37206) To better check that the code is working, this commit gives a distinct name (`DecoratedWrappedClass_1`) to the "adjacent" class declaration in the tests. PR Close #37206 --- .../ngcc/test/host/esm2015_host_spec.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts b/packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts index 8ef4acaabb..41954bd539 100644 --- a/packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts +++ b/packages/compiler-cli/ngcc/test/host/esm2015_host_spec.ts @@ -174,12 +174,13 @@ runInEachFileSystem(() => { ]; return AliasedWrappedClass; })(); - let DecoratedWrappedClass = /** @class */ (() => { - let DecoratedWrappedClass = class DecoratedWrappedClass {} - // ... add decorations ... - return DecoratedWrappedClass; - })(); let usageOfWrappedClass = AliasedWrappedClass_1; + let DecoratedWrappedClass = /** @class */ (() => { + let DecoratedWrappedClass_1 = class DecoratedWrappedClass {} + // ... add decorations ... + return DecoratedWrappedClass_1; + })(); + let usageOfDecorated = DecoratedWrappedClass_1; `, }; @@ -1970,7 +1971,7 @@ runInEachFileSystem(() => { !isNamedVariableDeclaration(classSymbol.adjacent.valueDeclaration)) { return fail('Expected a named variable declaration for the adjacent symbol'); } - expect(classSymbol.adjacent.valueDeclaration.name.text).toBe('DecoratedWrappedClass'); + expect(classSymbol.adjacent.valueDeclaration.name.text).toBe('DecoratedWrappedClass_1'); }); it('should return the class symbol for a decorated wrapped class expression (inner class expression)', @@ -2000,7 +2001,7 @@ runInEachFileSystem(() => { !isNamedVariableDeclaration(classSymbol.adjacent.valueDeclaration)) { return fail('Expected a named variable declaration for the adjacent symbol'); } - expect(classSymbol.adjacent.valueDeclaration.name.text).toBe('DecoratedWrappedClass'); + expect(classSymbol.adjacent.valueDeclaration.name.text).toBe('DecoratedWrappedClass_1'); }); it('should return the same class symbol (of the outer declaration) for decorated wrapped outer and inner declarations',