angular/packages/common/test/location/provide_location_mocks_spec.ts
Joey Perrott 0460a9dfaf refactor: migrate common to prettier formatting (#54150)
Migrate formatting to prettier for common from clang-format

PR Close #54150
2024-01-30 16:08:07 +00:00

22 lines
839 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.io/license
*/
import {Location, LocationStrategy} from '@angular/common';
import {MockLocationStrategy, provideLocationMocks, SpyLocation} from '@angular/common/testing';
import {TestBed} from '@angular/core/testing';
describe('provideLocationMocks() function', () => {
it('should mock Location and LocationStrategy classes', () => {
TestBed.configureTestingModule({providers: [provideLocationMocks()]});
const location = TestBed.inject(Location);
const locationStrategy = TestBed.inject(LocationStrategy);
expect(location).toBeInstanceOf(SpyLocation);
expect(locationStrategy).toBeInstanceOf(MockLocationStrategy);
});
});