test(ngcc): remove usage of ES2015 syntax in ES5/UMD/CommonJS tests (#34889)

This syntax is invalid in these source files and does result in
compilation errors as the constructor parameters could not be resolved.
This hasn't been an issue until now as those errors were ignored in the
tests, but future work to introduce the Trait system of ngtsc into
ngcc will cause these errors to prevent compilation, resulting in broken
tests.

PR Close #34889
This commit is contained in:
JoostK 2020-01-18 23:27:05 +01:00 committed by Andrew Kushnir
parent 5b42084912
commit ba82532812
3 changed files with 12 additions and 12 deletions

View File

@ -335,10 +335,10 @@ SOME DEFINITION TEXT
` { type: core.Directive, args: [{ selector: '[a]' }] },\n` +
` { type: OtherA }\n` +
` ];\n` +
` SomeDirective.ctorParameters = () => [\n` +
` SomeDirective.ctorParameters = function() { return [\n` +
` { type: core.NgZone },\n` +
` { type: core.Console }\n` +
` ];\n` +
` ]; };\n` +
` return SomeDirective;\n` +
`}());\n` +
`export {SomeDirective};`;
@ -352,10 +352,10 @@ SOME DEFINITION TEXT
renderer.addAdjacentStatements(output, compiledClass, 'SOME STATEMENTS');
expect(output.toString())
.toContain(
` SomeDirective.ctorParameters = () => [\n` +
` SomeDirective.ctorParameters = function() { return [\n` +
` { type: core.NgZone },\n` +
` { type: core.Console }\n` +
` ];\n` +
` ]; };\n` +
`SOME STATEMENTS\n` +
` return SomeDirective;\n`);
});

View File

@ -338,10 +338,10 @@ SOME DEFINITION TEXT
` { type: Directive, args: [{ selector: '[a]' }] },\n` +
` { type: OtherA }\n` +
` ];\n` +
` SomeDirective.ctorParameters = () => [\n` +
` SomeDirective.ctorParameters = function() { return [\n` +
` { type: NgZone },\n` +
` { type: Console }\n` +
` ];\n` +
` ]; };\n` +
` return SomeDirective;\n` +
`}());\n` +
`export {SomeDirective};`;
@ -355,10 +355,10 @@ SOME DEFINITION TEXT
renderer.addAdjacentStatements(output, compiledClass, 'SOME STATEMENTS');
expect(output.toString())
.toContain(
` SomeDirective.ctorParameters = () => [\n` +
` SomeDirective.ctorParameters = function() { return [\n` +
` { type: NgZone },\n` +
` { type: Console }\n` +
` ];\n` +
` ]; };\n` +
`SOME STATEMENTS\n` +
` return SomeDirective;\n`);
});

View File

@ -505,10 +505,10 @@ SOME DEFINITION TEXT
` { type: core.Directive, args: [{ selector: '[a]' }] },\n` +
` { type: OtherA }\n` +
` ];\n` +
` SomeDirective.ctorParameters = () => [\n` +
` SomeDirective.ctorParameters = function() { return [\n` +
` { type: core.NgZone },\n` +
` { type: core.Console }\n` +
` ];\n` +
` ]; };\n` +
` return SomeDirective;\n` +
` }());\n` +
` exports.SomeDirective = SomeDirective;\n` +
@ -523,10 +523,10 @@ SOME DEFINITION TEXT
renderer.addAdjacentStatements(output, compiledClass, 'SOME STATEMENTS');
expect(output.toString())
.toContain(
` SomeDirective.ctorParameters = () => [\n` +
` SomeDirective.ctorParameters = function() { return [\n` +
` { type: core.NgZone },\n` +
` { type: core.Console }\n` +
` ];\n` +
` ]; };\n` +
`SOME STATEMENTS\n` +
` return SomeDirective;\n`);
});