routerProvidersTest top-level constant
The main Router providers for testing.
Add these providers to your test bed for testing your route configuration or components with dependencies on the router.
@Component(
selector: '...',
providers: [
routerProvidersTest,
],
)
class TestComponent {}
Implementation
const routerProvidersTest = [
ClassProvider(MockLocationStrategy),
ExistingProvider(LocationStrategy, MockLocationStrategy),
ClassProvider(Location),
ClassProvider(Router, useClass: RouterImpl),
];