本文整理汇总了TypeScript中angular2/testing.xit函数的典型用法代码示例。如果您正苦于以下问题:TypeScript xit函数的具体用法?TypeScript xit怎么用?TypeScript xit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xit函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: xdescribe
xdescribe('AppComponent', function () {
beforeEachProviders(() => [
provide(APP_BASE_HREF, { useValue: '/' }),
provide(ApplicationRef, { useClass: MockApplicationRef }),
provide(ROUTER_PRIMARY_COMPONENT, { useValue: AppComponent })
]);
it('should instantiate component',
injectAsync([TestComponentBuilder], (tcb: TestComponentBuilder) => {
return tcb.createAsync(AppComponent).then(fixture => {
expect(fixture.componentInstance instanceof AppComponent).toBe(true, 'should create AppComponent');
});
}));
xit('should have expected <h1> text',
injectAsync([TestComponentBuilder], (tcb: TestComponentBuilder) => {
return tcb.createAsync(AppComponent).then(fixture => {
// fixture.detectChanges(); // need for a binding; we don't have one
let h1 = fixture.debugElement.query(el => el.name === 'h1').nativeElement;
expect(h1.innerText).toMatch(/angular 2 app/i, '<h1> should say something about "Angular 2 App"');
});
}));
});
示例2: describe
describe('universal truths', () => {
it('should do math', () => {
expect(1 + 1).toEqual(2);
expect(5).toBeGreaterThan(4);
});
xit('should skip this', () => {
expect(4).toEqual(40);
});
});
示例3: describe
describe('AppComponent', () => {
xit('should say hello',
injectAsync([ TestComponentBuilder ], (tcb: TestComponentBuilder) => {
return tcb.overrideProviders(AppComponent, ROUTER_PROVIDERS)
.createAsync(AppComponent)
.then(fixture => {
expect(fixture.nativeElement.textContent).toBe('Hello!');
});
}));
it('should pass', () => expect(true).toBe(true));
});
示例4: describe
describe('Color Picker', () => {
let possibilities: Array<string> = [
'red',
'#f00',
'f00',
'#ff0000',
'ff0000',
'#ff000000',
'ff000000',
'rgb 255 0 0',
'rgb (255, 0, 0)',
'rgb 1.0 0 0',
'rgb (1, 0, 0)',
'rgba (255, 0, 0, 1)',
'rgba 255, 0, 0, 1',
'rgba (1.0, 0, 0, 1)',
'rgba 1.0, 0, 0, 1',
'hsl(0, 100%, 50%)',
'hsl 0 100% 50%',
'hsla(0, 100%, 50%, 1)',
'hsla 0 100% 50%, 1',
'hsv(0, 100%, 100%)',
'hsv 0 100% 100%',
];
xit('Possibilities should be CSS readable.', () => {
possibilities.map((color: string) => {
expect(Color.isValidCss(color)).toBeTruthy();
});
});
it('...', () => {
possibilities.map((color: string) => {
console.log(Color.converter(color));
});
});
xit('Static helpers', () => {
Color.helpers.bound('32', 255);
});
});
示例5: describe
describe('Application Shell', () => {
var shell: AppShell;
beforeEachProviders(() => {
return [
BlogService,
provide(BlogRoll, { useValue: { }})
];
});
xit('Can be created', injectAsync([TestComponentBuilder], (tcb) => {
return tcb.createAsync(AppShell)
.then((fixture) => {
fixture.detectChanges();
let blogRoll = fixture.nativeElement.getElementsByTagName('<blog-roll>');
expect(blogRoll).toBeDefined();
});
}));
});
示例6: describe
describe('some component', () => {
xit('has a test', () => { throw 'This test will not run.'; });
it('has another test', () => {
// This test will run.
});
});