While working in Angular 2.0.0, I encountered an issue when unit testing a component that utilizes Router. The error 'Supplied parameters do not match any signature of call target.' keeps appearing, with Visual Studio Code highlighting the new Router() in red within the spec.ts file.
Can someone provide guidance on the correct syntax to resolve this?
Here is my code snippet:
spec.ts
import { TestBed, async } from '@angular/core/testing';
import { NavToolComponent } from './nav-tool.component';
import { ComponentComm } from '../../shared/component-comm.service';
import { Router } from '@angular/router';
describe('Component: NavTool', () => {
it('should create an instance', () => {
let component = new NavToolComponent( new ComponentComm(), new Router());
expect(component).toBeTruthy();
});
});
Component constructor
constructor(private componentComm: ComponentComm, private router: Router) {}