當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript testing.expect函數代碼示例

本文整理匯總了TypeScript中angular2/testing.expect函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript expect函數的具體用法?TypeScript expect怎麽用?TypeScript expect使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了expect函數的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: expect

 subscription = observable.subscribe(val => {
   expect(val).toBe(null);
   done();
 });
開發者ID:hammadhassan,項目名稱:angularfire2,代碼行數:4,代碼來源:firebase_object_factory.spec.ts

示例2: expect

          .then((rootTC: any) => {
            let aboutDOMEl = rootTC.debugElement.children[0].nativeElement;

            expect(DOM.querySelectorAll(aboutDOMEl, 'h2')[0].textContent).toEqual('Features');
          });
開發者ID:AlbertOzimek,項目名稱:oziim.com,代碼行數:5,代碼來源:about.component.spec.ts

示例3: it

 it('validates email', () => {
   const validEmail = new Control('test@test.com');
   const invalidEmail = new Control('test');
   expect(Validators.email(validEmail)).toBeUndefined();
   expect(Validators.email(invalidEmail)).toEqual({email: false});
 });
開發者ID:windwang,項目名稱:angular2-app,代碼行數:6,代碼來源:Validator.spec.ts

示例4: it

 it('should have id as assigned',() => {
     expect(employee.id).toEqual(1);
 });
開發者ID:abhinavmsra,項目名稱:angular2,代碼行數:3,代碼來源:employee.spec.ts

示例5: it

      it('should call API to get collection of a known model', () => {
        apiService.getCollection('person');

        expect(apiService.getCollectionByUrl).toHaveBeenCalled();
        expect(apiService.getCollectionByUrl).toHaveBeenCalledWith('http://localhost:8000/people');
      });
開發者ID:gitter-badger,項目名稱:hydra-admin,代碼行數:6,代碼來源:api.spec.ts

示例6: it

 it('should get the meaning of life', inject([ReduxTwoApp], (app: ReduxTwoApp) => {
   expect(app.meaningOfLife()).toBe('The meaning of life is 42');
   expect(app.meaningOfLife(22)).toBe('The meaning of life is 22');
 }));
開發者ID:gotstago,項目名稱:rxjs-learning,代碼行數:4,代碼來源:redux-two.spec.ts

示例7: expect

 return tcb.createAsync(UserListItemComponent).then((fixture: ComponentFixture) => {
   fixture.componentInstance.id = 15;
   fixture.componentInstance.viewDetails();
   expect(mockRouter.navigate).toHaveBeenCalledWith(['/UserDetail', {userId: 15}]);
 });
開發者ID:TNNSon,項目名稱:angular2-unit-test-app,代碼行數:5,代碼來源:user-list-item.component.spec.ts

示例8: expect

 return tcb.createAsync(AppComponent).then(fixture => {
   expect(fixture.componentInstance instanceof AppComponent).toBe(true, 'should create AppComponent');
 });
開發者ID:chmoreau,項目名稱:lyonroute-webapp,代碼行數:3,代碼來源:app.component.spec.ts

示例9: it

 it('is created', inject([SocketService], service => {
     expect(service).toBeDefined();
 }));
開發者ID:JonathanYates,項目名稱:report-ticker-angular2,代碼行數:3,代碼來源:socket.service.spec.ts

示例10: it

 it('should provide default id', inject([APP_ID], (id) => {
   expect(id).toBe('a');
 }));
開發者ID:Sophia-nguyen,項目名稱:karma-test,代碼行數:3,代碼來源:using-injector_test.ts


注:本文中的angular2/testing.expect函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。