Angular2 App을 Angular2 Cli를 사용하여 빌드하고 있습니다. 나는 (NPM 시작) 나는이 오류를각도 2 제공된 매개 변수가 호출 타겟 (spec.ts)의 서명과 일치하지 않습니다.
...angular2/tmp/broccoli_type_script_compiler-input_base_path-wKrIZXNv.tmp/0/src/app/notifications/notifications.component.spec.ts (10, 21): Supplied parameters do not match any signature of call target
파일 notifications.component.spec.ts를 얻을 수를 만들 때이
constructor(private _elRef: ElementRef) {}
같은 생성자가 각도에 의해 생성 된 notifications.component이 나는 모든 것이 잘 작동 생성자 매개 변수없이 구축 할 경우 CLI는, 그러나이
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { addProviders, async, inject } from '@angular/core/testing';
import { NotificationsComponent } from './notifications.component';
describe('Component: Notifications',() => {
it('should create an instance',() => {
let component = new NotificationsComponent();
expect(component).toBeTruthy();
});
});
같다. 빌드 후에이 매개 변수를 추가하면 모든 것이 잘 작동합니다.
내가 무엇을 놓치고 있습니까?
알아 두었지만 인수를 제공하려했지만 작동하지 않습니다! 당신의 제안은 무엇입니까? –
'NotificationsComponent'가'ElementRef'를 필요로하지 않는다면, 생성자에서 그것을 제거하십시오. 그렇지 않으면 어떤 테스트 프레임 워크가 사용 중인지 확인하고 스텁을 피드 프레임에 제공 할 수 있습니다. –
제거 할 수는 있지만 해결 방법을 알고 싶습니다! –