我使用ng generate component test
创建了一个组件,几乎没有生成任何文件。有一个文件名test.component.spec.ts
。它具有此内容。
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TestComponent } from './donations-pay.component';
describe('TestComponent ', () => {
let component: TestComponent ;
let fixture: ComponentFixture<TestComponent >;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ TestComponent]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(TestComponent );
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should be created', () => {
expect(component).toBeTruthy();
});
});
我很难理解这一点。请帮我。 谢谢