MockPlatformLocation
Class
stable
Mock implementation of URL state.
API
class MockPlatformLocation implements PlatformLocation { constructor(config?: MockPlatformLocationConfig | undefined): MockPlatformLocation; readonly hostname: string; readonly protocol: string; readonly port: string; readonly pathname: string; readonly search: string; readonly hash: string; readonly state: unknown; getBaseHrefFromDOM(): string; onPopState(fn: LocationChangeListener): VoidFunction; onHashChange(fn: LocationChangeListener): VoidFunction; readonly href: string; readonly url: string; replaceState(state: any, title: string, newUrl: string): void; pushState(state: any, title: string, newUrl: string): void; forward(): void; back(): void; historyGo(relativePosition?: number): void; getState(): unknown;}
constructor
MockPlatformLocation@returns
MockPlatformLocationhostname
stringprotocol
stringport
stringpathname
stringsearch
stringhash
stringstate
unknowngetBaseHrefFromDOM
string@returns
stringonPopState
VoidFunction@paramfn
LocationChangeListener@returns
VoidFunctiononHashChange
VoidFunction@paramfn
LocationChangeListener@returns
VoidFunctionhref
stringurl
stringreplaceState
void@paramstate
any@paramtitle
string@paramnewUrl
string@returns
voidpushState
void@paramstate
any@paramtitle
string@paramnewUrl
string@returns
voidforward
void@returns
voidback
void@returns
voidhistoryGo
void@paramrelativePosition
number@returns
voidgetState
unknown@returns
unknownJump to details