本文整理匯總了TypeScript中@angular/compiler/testing/resource_loader_mock.MockResourceLoader.get方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript MockResourceLoader.get方法的具體用法?TypeScript MockResourceLoader.get怎麽用?TypeScript MockResourceLoader.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@angular/compiler/testing/resource_loader_mock.MockResourceLoader
的用法示例。
在下文中一共展示了MockResourceLoader.get方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: inject
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
var url = '/foo';
resourceLoader.when(url, 'when');
resourceLoader.expect(url, 'expect');
expectResponse(resourceLoader.get(url), url, 'expect');
expectResponse(resourceLoader.get(url), url, 'when', () => async.done());
resourceLoader.flush();
}));
示例2: it
it('should not reuse expectations', () => {
var url = '/foo';
var response = 'bar';
resourceLoader.expect(url, response);
resourceLoader.get(url);
resourceLoader.get(url);
expect(() => { resourceLoader.flush(); }).toThrowError('Unexpected request /foo');
});
示例3: inject
inject([AsyncTestCompleter], (async: AsyncTestCompleter) => {
const url = '/foo';
const response: string = null;
resourceLoader.expect(url, response);
expectResponse(resourceLoader.get(url), url, response, () => async.done());
resourceLoader.flush();
}));