Skip to content

Commit

Permalink
test: enable ctor parameter transformer test that was previously disa…
Browse files Browse the repository at this point in the history
…bled
  • Loading branch information
alan-agius4 authored and vikerman committed Sep 27, 2019
1 parent a6a49b2 commit f548bdd
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions packages/ngtools/webpack/src/transformers/ctor-parameters_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,13 @@ describe('Constructor Parameter Transformer', () => {
expect(tags.oneLine`${result}`).toEqual(tags.oneLine`${output}`);
});

// The current testing infrastructure does not support this test
// Aliased TS symbols are resolved to 'unknown'
xit('records class name of root-provided injectable in imported module', () => {
it('records class name of root-provided injectable in imported module', () => {
const rootProvided = {
'root-provided-service': `
'root-provided-service.ts': `
@Injectable({
providedIn: 'root'
})
export class RootProvidedService {
constructor() { }
}
`,
Expand All @@ -117,7 +114,17 @@ describe('Constructor Parameter Transformer', () => {
}
`;

const output = `export class MyService { constructor(v) { } } MyService.ctorParameters = () => [ { type: RootProvidedService } ];`;
const output = `
import * as tslib_1 from "tslib";
import { RootProvidedService } from './root-provided-service';
let MyService = class MyService {
constructor(v) { }
};
MyService.ctorParameters = () => [ { type: RootProvidedService } ];
MyService = tslib_1.__decorate([ Injectable() ], MyService);
export { MyService };
`;

const result = transform(input, rootProvided);

Expand Down

0 comments on commit f548bdd

Please sign in to comment.