Skip to content

Commit

Permalink
fixup! feat(platform-browser): include Location mocks into testing en…
Browse files Browse the repository at this point in the history
…vironment by default
  • Loading branch information
AndrewKushnir committed Sep 14, 2022
1 parent 87f870c commit d6509e5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/platform-browser/testing/src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
* 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, LocationStrategy} from '@angular/common';
import {MockLocationStrategy, SpyLocation} from '@angular/common/testing';
import {PlatformLocation} from '@angular/common';
import {MockPlatformLocation} from '@angular/common/testing';
import {APP_ID, createPlatformFactory, NgModule, NgZone, PLATFORM_INITIALIZER, platformCore, StaticProvider} from '@angular/core';
import {BrowserModule, ɵBrowserDomAdapter as BrowserDomAdapter} from '@angular/platform-browser';

Expand Down Expand Up @@ -38,8 +38,7 @@ export const platformBrowserTesting =
providers: [
{provide: APP_ID, useValue: 'a'},
{provide: NgZone, useFactory: createNgZone},
{provide: Location, useClass: SpyLocation},
{provide: LocationStrategy, useClass: MockLocationStrategy},
{provide: PlatformLocation, useClass: MockPlatformLocation},
]
})
export class BrowserTestingModule {
Expand Down

0 comments on commit d6509e5

Please sign in to comment.