Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

@angular/common/testing

Supplies infrastructure for testing functionality supplied by @angular/common.

Entry point exports

Classes

MockLocationStrategy

A mock implementation of LocationStrategy that allows tests to fire simulated location events.

MockPlatformLocation

Mock implementation of URL state.

SpyLocation

A spy for Location that allows tests to fire simulated location events.

Functions

provideLocationMocks

Returns mock providers for the Location and LocationStrategy classes. The mocks are helpful in tests to fire simulated location events.

Structures

MockPlatformLocationConfig

Mock platform location config

Types

MOCK_PLATFORM_LOCATION_CONFIG

Provider for mock platform location config