angular/packages/common/testing/src/provide_location_mocks.ts
Joey Perrott 9dbe6fc18b refactor: update license text to point to angular.dev (#57901)
Update license text to point to angular.dev instead of angular.io

PR Close #57901
2024-09-24 15:33:00 +02:00

26 lines
769 B
TypeScript

/**
* @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.dev/license
*/
import {Location, LocationStrategy} from '@angular/common';
import {Provider} from '@angular/core';
import {SpyLocation} from './location_mock';
import {MockLocationStrategy} from './mock_location_strategy';
/**
* Returns mock providers for the `Location` and `LocationStrategy` classes.
* The mocks are helpful in tests to fire simulated location events.
*
* @publicApi
*/
export function provideLocationMocks(): Provider[] {
return [
{provide: Location, useClass: SpyLocation},
{provide: LocationStrategy, useClass: MockLocationStrategy},
];
}