当前位置: 首页>>代码示例>>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;未经允许,请勿转载。