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.
Expectation: Running the tests with
npm testworks.Actual: The test file
highlighted.directive.spec.tscurrently looks like this on master:However, the only constructor of
HighlightedDirectivehas a non-optional argument:A similar problem exists with
ngx-useless.directive.spec.tsandngx-useless.directive.ts, here we're missing two parameters:For this reason, running
npm testproduces the following error message: