【发布时间】:2019-11-20 09:11:11
【问题描述】:
无论我做什么,仍然无法使测试正常运行。尽管通过所有其他帖子我尝试了所有可能的解决方案,但仍然无法正常工作。
设置jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;我认为它会起作用,但没有成功。
任何想法如何解决这个问题?
describe('DashboardComponent', () => {
let component: DashboardComponent;
let fixture: ComponentFixture<DashboardComponent>;
let therapistStatus = TherapistStatus;
let id = '';
let firstName = '';
let lastName = '';
let email = '';
let status = 2;
let statusChanges = '';
let therapist = new Therapist({id, firstName, lastName, email, status, statusChanges});
beforeEach(async(() => {
jasmine.DEFAULT_TIMEOUT_INTERVAL = 30000;
TestBed.configureTestingModule({
declarations: [ DashboardComponent],
schemas: [NO_ERRORS_SCHEMA],
imports: [
RouterTestingModule,
FormsModule,
OAuthModule.forRoot(),
ToastrModule.forRoot(),
HttpClientTestingModule,
ReactiveFormsModule,
TranslateModule.forRoot()
],
providers: [UserService]
})
.compileComponents().then(() => {
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
});
}));
beforeEach(() => {
fixture = TestBed.createComponent(DashboardComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create the dashboard component', () => {
expect(component).toBeTruthy();
});
【问题讨论】:
标签: angular jasmine karma-jasmine