Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The tests highlighted.directive.spec.ts and ngx-useless.directive.spec.ts won't compile #6

Open
blalasaadri opened this issue Jun 30, 2019 · 0 comments

Comments

@blalasaadri
Copy link

Expectation: Running the tests with npm test works.

Actual: The test file highlighted.directive.spec.ts currently looks like this on master:

import { HighlightedDirective } from './highlighted.directive';

describe('HighlightedDirective', () => {
  it('should create an instance', () => {
    const directive = new HighlightedDirective();
    expect(directive).toBeTruthy();
  });
});

However, the only constructor of HighlightedDirective has a non-optional argument:

constructor(private coursesService: CoursesService) {

    console.log('coursesService highlighted ' + coursesService.id);

}

A similar problem exists with ngx-useless.directive.spec.ts and ngx-useless.directive.ts, here we're missing two parameters:

constructor(private templateRef: TemplateRef<any>,
            private viewContainer: ViewContainerRef) {


}

For this reason, running npm test produces the following error message:

ERROR in src/app/courses/directives/highlighted.directive.spec.ts(5,23): error TS2554: Expected 1 arguments, but got 0.
src/app/courses/directives/ngx-unless.directive.spec.ts(5,23): error TS2554: Expected 2 arguments, but got 0.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant