/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { Location } from '@angular/common'; import { provideLocationMocks } from '@angular/common/testing'; import { Compiler, inject, Injector, NgModule } from '@angular/core'; import { ChildrenOutletContexts, NoPreloading, Router, ROUTER_CONFIGURATION, RouteReuseStrategy, RouterModule, ROUTES, TitleStrategy, UrlHandlingStrategy, UrlSerializer, withPreloading, ɵROUTER_PROVIDERS as ROUTER_PROVIDERS } from '@angular/router'; import * as i0 from "@angular/core"; function isUrlHandlingStrategy(opts) { // This property check is needed because UrlHandlingStrategy is an interface and doesn't exist at // runtime. return 'shouldProcessUrl' in opts; } function throwInvalidConfigError(parameter) { throw new Error(`Parameter ${parameter} does not match the one available in the injector. ` + '`setupTestingRouter` is meant to be used as a factory function with dependencies coming from DI.'); } /** * Router setup factory function used for testing. * * @publicApi * @deprecated Use `provideRouter` or `RouterModule` instead. */ export function setupTestingRouter(urlSerializer, contexts, location, compiler, injector, routes, opts, urlHandlingStrategy, routeReuseStrategy, titleStrategy) { // Note: The checks below are to detect misconfigured providers and invalid uses of // `setupTestingRouter`. This function is not used internally (neither in router code or anywhere // in g3). It appears this function was exposed as publicApi by mistake and should not be used // externally either. However, if it is, the documented intent is to be used as a factory function // and parameter values should always match what's available in DI. if (urlSerializer !== inject(UrlSerializer)) { throwInvalidConfigError('urlSerializer'); } if (contexts !== inject(ChildrenOutletContexts)) { throwInvalidConfigError('contexts'); } if (location !== inject(Location)) { throwInvalidConfigError('location'); } if (compiler !== inject(Compiler)) { throwInvalidConfigError('compiler'); } if (injector !== inject(Injector)) { throwInvalidConfigError('injector'); } if (routes !== inject(ROUTES)) { throwInvalidConfigError('routes'); } if (opts) { // Handle deprecated argument ordering. if (isUrlHandlingStrategy(opts)) { if (opts !== inject(UrlHandlingStrategy)) { throwInvalidConfigError('opts (UrlHandlingStrategy)'); } } else { if (opts !== inject(ROUTER_CONFIGURATION)) { throwInvalidConfigError('opts (ROUTER_CONFIGURATION)'); } } } if (urlHandlingStrategy !== inject(UrlHandlingStrategy)) { throwInvalidConfigError('urlHandlingStrategy'); } if (routeReuseStrategy !== inject(RouteReuseStrategy)) { throwInvalidConfigError('routeReuseStrategy'); } if (titleStrategy !== inject(TitleStrategy)) { throwInvalidConfigError('titleStrategy'); } return new Router(); } /** * @description * * Sets up the router to be used for testing. * * The modules sets up the router to be used for testing. * It provides spy implementations of `Location` and `LocationStrategy`. * * @usageNotes * ### Example * * ``` * beforeEach(() => { * TestBed.configureTestingModule({ * imports: [ * RouterModule.forRoot( * [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}] * ) * ] * }); * }); * ``` * * @publicApi */ export class RouterTestingModule { static withRoutes(routes, config) { return { ngModule: RouterTestingModule, providers: [ { provide: ROUTES, multi: true, useValue: routes }, { provide: ROUTER_CONFIGURATION, useValue: config ? config : {} }, ] }; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); } static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] }); } static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RouterTestingModule, providers: [ ROUTER_PROVIDERS, provideLocationMocks(), withPreloading(NoPreloading).ɵproviders, { provide: ROUTES, multi: true, useValue: [] }, ], imports: [RouterModule] }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: RouterTestingModule, decorators: [{ type: NgModule, args: [{ exports: [RouterModule], providers: [ ROUTER_PROVIDERS, provideLocationMocks(), withPreloading(NoPreloading).ɵproviders, { provide: ROUTES, multi: true, useValue: [] }, ] }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm91d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