本文整理汇总了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;未经允许,请勿转载。 |
请发表评论