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


TypeScript testing.xit函數代碼示例

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


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

示例1: describe

describe('AppComponent', () => {

    let router : Router, location: Location;
    beforeEachProviders(() => [
        ROUTER_FAKE_PROVIDERS,
        RouteRegistry,
        provide(Location, {useClass: SpyLocation}),
        provide(LocationStrategy, {useClass: MockLocationStrategy}),
        provide(ROUTER_PRIMARY_COMPONENT, {useValue: AppComponent}),
        provide(Router, {useClass: RootRouter}),
        HTTP_PROVIDERS,
        BaseRequestOptions,
        provide(ConnectionBackend, {useClass: MockBackend}),
        Http,
        provide(ApplicationRef, { useClass: MockApplicationRef }),
        TestComponentBuilder
    ]);

    beforeEach(inject([Router, Location], (rtr, loc) => {
      router = rtr;
      location = loc;
    }));

    it('should be defined after injection', inject([TestComponentBuilder], (tbc) => {
        tbc.createAsync(AppComponent).then((fixture:ComponentFixture<AppComponent>) => expect(fixture.componentRef).toBeDefined())
    }));

    xit('should initialize Dashboard-route in Router', () =>{
        var instruction = router.generate(['Dashboard']);
        var path = instruction.toRootUrl();
        expect(path).toEqual('');
    });

});
開發者ID:GreenToast,項目名稱:Angular2Starter,代碼行數:34,代碼來源:app.component.spec.ts

示例2: describe

describe('GradeStudentListComponent', () => {
  beforeEachProviders(() => [
    TestComponentBuilder,
    {provide: PLATFORM_DIRECTIVES, multi: true, useValue: ROUTER_DIRECTIVES}
  ]);

  let fixture: ComponentFixture<GradeStudentListComponent>;

  beforeEach(injectAsync([TestComponentBuilder], tcb => {
    tcb.overrideProviders(GradeStudentListComponent, [
      provide(StudentService, {useClass: MockService}),
      provide(TeacherService, {useClass: MockService})
    ])
      .overrideDirective(ClassSelectorComponent, MockComponent)
      .createAsync(GradeStudentListComponent).then(fix => {
      fixture = fix;
    });
  }));

  xit('should list students', () => {
    fixture.componentInstance.students = [
      new Student.Builder().build()
    ];
    fixture.detectChanges();
    console.log(fixture.nativeElement);
    expect(fixture.nativeElement).toBeDefined();
  });
});
開發者ID:bryant-pham,項目名稱:brograder,代碼行數:28,代碼來源:grade-student-list.component.spec.ts

示例3: describe

    describe('GeoLocation Service', () => {
        let service;

        // setup
        beforeEachProviders(() => {
            return [
                geoLocationService
            ]
        });

        beforeEach(inject([geoLocationService], (_service) => {
            service = _service;
        }));

        // specs
        //Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        xit('should create service', done => {
            service.getGeoLoc().subscribe(
                x => {
                    console.log(x);
                },
                done()
            );
        });
    });
開發者ID:am-jo-zt,項目名稱:ng2-tdd,代碼行數:25,代碼來源:geolocation.service.spec.ts

示例4: describe

describe('Product Service', () => {
  beforeEachProviders(() => [ProductService]);

  xit('should ...',
      inject([ProductService], (service: ProductService) => {
    expect(service).toBeTruthy();
  }));
});
開發者ID:Cr4ck3rs,項目名稱:BE-Angular2-Course-Exam,代碼行數:8,代碼來源:product.service.spec.ts

示例5: describe

describe('Component: Home', () => {
  let http:Http;
  let _productService:ProductService = new ProductService(http);
  beforeEachProviders(()=>[HomeComponent, ProductService]);
  xit('should create an instance', () => {
    let component = new HomeComponent(_productService);
    expect(component).toBeTruthy();
  });
});
開發者ID:jcyovera,項目名稱:AngularTypeScriptV2,代碼行數:9,代碼來源:home.component.spec.ts

示例6: describe

  describe('Builder', () => {
    xit('should build assignment with default questions if not passed in', () => {
      let assignment = Assignment.Builder.buildAssignment('test');

      expect(assignment.questions).toEqual([new Question('1', 4, 'A')]);
      expect(assignment.questions.length).toBe(1);
      expect(assignment.name).toBe('test');
      expect(assignment.dueDate).toBeDefined();
      expect(assignment.numOfQuestions).toBe(1);
    });

    it('should build assignment with specified questions', () => {
      let assignment = Assignment.Builder
        .buildAssignment(
          'test',
          new Question('1', 4, 'B'),
          new Question('1', 4, 'B'));

      expect(assignment.questions).toEqual([
        new Question('1', 4, 'B'),
        new Question('1', 4, 'B')]);
      expect(assignment.questions.length).toBe(2);
      expect(assignment.name).toBe('test');
      expect(assignment.dueDate).toBeDefined();
      expect(assignment.numOfQuestions).toBe(2);
    });

    xit('should build multiple assignments specified names and default questions', () => {
      let assignments = Assignment.Builder.buildAssignments('test1', 'test2');

      expect(assignments.length).toBe(2);

      expect(assignments[0].name).toBe('test1');
      expect(assignments[0].questions).toEqual([new Question('1', 4, 'A')]);
      expect(assignments[0].dueDate).toBeDefined();
      expect(assignments[0].numOfQuestions).toBe(1);

      expect(assignments[1].name).toBe('test2');
      expect(assignments[1].questions).toEqual([new Question('1', 4, 'A')]);
      expect(assignments[1].dueDate).toBeDefined();
      expect(assignments[1].numOfQuestions).toBe(1);
    });
  });
開發者ID:bryant-pham,項目名稱:brograder,代碼行數:43,代碼來源:assignment.model.spec.ts

示例7: describe

describe('App', () => {
  beforeEachProviders(() => [
    AppComponent
  ]);
  it('should work', inject([AppComponent], (app: AppComponent) => {
    // Add real test here
    expect(2).toBe(2);
  }));

  xit('should skip', () => {
    expect(true).toBe(false);
  });
});
開發者ID:gitter-badger,項目名稱:ubiquits,代碼行數:13,代碼來源:app.component.spec.ts

示例8: describe

describe('App', () => {
  // provide our implementations or mocks to the dependency injector
  beforeEachProviders(() => [
    // AppState,
    App
  ]);

  xit('should have a start', inject([ App ], (app) => {
    console.log(app);
    expect(app.start).toEqual(true);
  }));

});
開發者ID:DavyDuDu,項目名稱:echoes-ng2,代碼行數:13,代碼來源:app.spec.ts

示例9: describe

describe('Application Shell', () => {
    var shell: AppShellComponent;

    beforeEachProviders(() => {
        return [
          BlogService,
          provide(BlogRoll, { useValue: { }})
        ];
    });

    xit('Can be created', injectAsync([TestComponentBuilder], (tcb) => {
        return tcb.createAsync(AppShellComponent)
            .then((fixture) => {
                fixture.detectChanges();
                let blogRoll = fixture.nativeElement.getElementsByTagName('<blog-roll>');
                expect(blogRoll).toBeDefined();
            });
    }));
});
開發者ID:7Silvan,項目名稱:angular2-unittest-samples-rc,代碼行數:19,代碼來源:app-shell.spec.ts

示例10: xdescribe

xdescribe('FooComponent', () => {

    xit('should have value',
        inject([TestComponentBuilder], (tcb: TestComponentBuilder) => {
            tcb
                .createAsync(TestTemplate)
                .then((componentFixture: ComponentFixture<TestTemplate>) => {

                    // given
                    const element: HTMLElement = componentFixture.nativeElement;

                    // execute
                    componentFixture.detectChanges();

                    // assert
                    expect(componentFixture.debugElement.children[0].componentInstance.bar).toEqual('ttr');

                });

        })
    );

});
開發者ID:amazingCreate,項目名稱:ng2-datatables,代碼行數:23,代碼來源:foo.component.spec.ts


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