本文整理汇总了TypeScript中@angular/core/testing.resetBaseTestProviders函数的典型用法代码示例。如果您正苦于以下问题:TypeScript resetBaseTestProviders函数的具体用法?TypeScript resetBaseTestProviders怎么用?TypeScript resetBaseTestProviders使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resetBaseTestProviders函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: resetBaseTestProviders
declare var System: any;
declare var Zone: any;
import {resetBaseTestProviders, setBaseTestProviders, MockApplicationRef} from "@angular/core/testing";
import {BROWSER_APP_DYNAMIC_PROVIDERS} from "@angular/platform-browser-dynamic";
import {
TEST_BROWSER_STATIC_PLATFORM_PROVIDERS,
ADDITIONAL_TEST_BROWSER_PROVIDERS
} from "@angular/platform-browser/testing";
import {MATERIAL_BROWSER_PROVIDERS} from "../../index";
import {TestUrlResolver} from "./test_url_resolver";
import {UrlResolver} from "@angular/compiler";
import {provide, ApplicationRef} from "@angular/core";
resetBaseTestProviders();
setBaseTestProviders(
TEST_BROWSER_STATIC_PLATFORM_PROVIDERS,
[
...BROWSER_APP_DYNAMIC_PROVIDERS,
...ADDITIONAL_TEST_BROWSER_PROVIDERS,
...MATERIAL_BROWSER_PROVIDERS,
provide(ApplicationRef, {useClass: MockApplicationRef}),
provide(UrlResolver, {useValue: new TestUrlResolver()})
]
);
function onlySpecFiles(path) {
return /_spec\.js$/.test(path);
}
示例2: beforeEach
beforeEach(() => {
resetBaseTestProviders();
setBaseTestProviders(TEST_BROWSER_DYNAMIC_PLATFORM_PROVIDERS,
TEST_BROWSER_DYNAMIC_APPLICATION_PROVIDERS);
addProviders([ChessService, TestComponentBuilder]);
});