本文整理匯總了TypeScript中@angular/core/testing.expect函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript expect函數的具體用法?TypeScript expect怎麽用?TypeScript expect使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了expect函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: inject
inject([CheckmarkPipe], function(checkmarkPipe: CheckmarkPipe) {
expect(checkmarkPipe.transform(true)).toBe('\u2713');
expect(checkmarkPipe.transform(false)).toBe('\u2718');
})
示例2: inject
inject([MedjsAngularjs2FirebaseAppComponent], (app: MedjsAngularjs2FirebaseAppComponent) => {
expect(app.title).toEqual('medjs-angularjs2-firebase works!');
}));
開發者ID:juancarlosmaldonadobeltran,項目名稱:medjs-angularjs2-firebase,代碼行數:3,代碼來源:medjs-angularjs2-firebase.component.spec.ts
示例3: inject
inject([AppComponent], (app: AppComponent) => {
expect(app).toBeTruthy();
}));
示例4: inject
inject([ChoicesService], (service: ChoicesService) => {
expect(service).toBeTruthy();
}));
示例5: expect
.then((fixture: ComponentFixture<any>) => {
let query = fixture.debugElement.query(By.directive(ChatComponent));
expect(query).toBeTruthy();
expect(query.componentInstance).toBeTruthy();
});
示例6: it
it("data should be three first items when page change", ()=> {
datatable.setPage(1,3);
datatable.ngDoCheck();
expect(datatable.data).toEqual([{id: 3, name: 'Poland'},{id: 1, name: 'Slovakia'},{id: 2, name: 'Czech'}]);
});
示例7: it
it('should create an instance', () => {
let component = new PostDetailComponent(fb, route, router, store, location);
expect(component).toBeTruthy();
});
示例8: it
it('should create the app', inject([AppComponent], (app: AppComponent) => {
expect(app).toBeTruthy();
})
示例9: inject
inject([TooltipService], (service:TooltipService) => {
expect(service.setTooltipData({y:'one'})).toBe('one');
expect(service.setTooltipData({tooltip:'tip'})).toBe('tip');
}));