typescript Angular 2+ Jasmine测试规格样板
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了typescript Angular 2+ Jasmine测试规格样板相关的知识,希望对你有一定的参考价值。
import { TestBed, ComponentFixture } from "@angular/core/testing";
import { NO_ERRORS_SCHEMA } from "@angular/core";
import { NoopAnimationsModule } from "@angular/platform-browser/animations";
import { MyComponent } from "myfile";
describe('MyComponent', () => {
let fixture: ComponentFixture<MyComponent>;
let component: MyComponent;
beforeEach(() => {
TestBed.configureTestingModule({
imports: [
NoopAnimationsModule,
],
declarations: [
MyComponent
],
providers: [],
schemas: [NO_ERRORS_SCHEMA],
});
fixture = TestBed.createComponent(MyComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
describe(`myFunction()`, () => {
it(`should do something`, () => {});
});
});
以上是关于typescript Angular 2+ Jasmine测试规格样板的主要内容,如果未能解决你的问题,请参考以下文章