本文整理匯總了TypeScript中@angular/common/testing.SpyLocation.path方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript SpyLocation.path方法的具體用法?TypeScript SpyLocation.path怎麽用?TypeScript SpyLocation.path使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@angular/common/testing.SpyLocation
的用法示例。
在下文中一共展示了SpyLocation.path方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should navigate to a conversation', fakeAsync(() => {
router.navigateByUrl("/inbox");
advance(f);
const c = f.debugElement.query(e => e.nativeElement.textContent === "The Myth of Sisyphus");
c.nativeElement.click();
advance(f);
expect(location.path()).toEqual("/inbox/0");
expect(f.nativeElement).toHaveText("The Path of the Absurd Man");
}));
示例2: expect
router.navigate(['About']).then(() => {
expect(spylocation.path()).toBe('/about')
done()
}).catch(e => done.fail(e))
示例3: it
it('should navigate to "Dashboard" immediately', fakeAsync(() => {
createComponent();
tick(); // wait for async data to arrive
expect(location.path()).toEqual('/dashboard', 'after initialNavigation()');
expectElementOf(DashboardComponent);
}));
示例4: expectPathToBe
function expectPathToBe(path: string, expectationFailOutput?: any) {
expect(location.path()).toEqual(path, expectationFailOutput || 'location.path()');
}