嘿,我是 angular 6(又名 angular)测试的新手,我有一个问题是要重新评估我迄今为止看到的每一个测试。
我们先来看一个简单组件的简单测试(由cli生成)
describe('CompComponent', () => {
let component: CompComponent;
let fixture: ComponentFixture<CompComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CompComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(CompComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
我有一个主要问题:
1.我如何确定每个 Async beforeEach 调用是在每个测试单元(又名它)之前完成的?是否存在这种调用会在每次调用之后发生的情况,因为它毕竟是异步调用?