0
각도 2로 구성 요소를 테스트하려고하는데 종속성로드 문제가 있습니다.각도 2 테스트 종속성
을 테스트 할 때 UserModule
을 가져 오려고하면 갈마 오류가 발생하며 가져 오지 않으면 구성 요소 오류가 많이 발생합니다.
테스트 설정
는 각-CLI가 생성 내 특정 시험이 (가)import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';
import { UserModule } from '../../user.module';
import { UserShowcaseComponent } from './user-showcase.component';
describe('UserShowcaseComponent',() => {
let component: UserShowcaseComponent;
let fixture: ComponentFixture<UserShowcaseComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [UserModule], <---------------------------------- NOTE
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(UserShowcaseComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create',() => {
expect(component).toBeTruthy();
});
});
다음 카르마에서 오류가 단순히 무엇이며이 (이 어떤 테스트가 실행되지 않습니다 전체 출력) :
29 11 2016 16:49:40.478:INFO [karma]: Karma v1.2.0 server started at http://localhost:9876/
29 11 2016 16:49:40.479:INFO [launcher]: Launching browser Chrome with unlimited concurrency
29 11 2016 16:49:40.649:INFO [launcher]: Starting browser Chrome
29 11 2016 16:49:42.010:INFO [Chrome 53.0.2785 (Linux 0.0.0)]: Connected on socket /#Jpv1IioGnou6CQtUAAAA with id 98117142
Chrome 53.0.2785 (Linux 0.0.0) ERROR