本文整理汇总了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('');
});
});
示例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();
});
});
示例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()
);
});
});
示例4: describe
describe('Product Service', () => {
beforeEachProviders(() => [ProductService]);
xit('should ...',
inject([ProductService], (service: ProductService) => {
expect(service).toBeTruthy();
}));
});
示例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();
});
});
示例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);
});
});
示例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);
});
});
示例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);
}));
});
示例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();
});
}));
});
示例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');
});
})
);
});