ci: move public-api goldens to goldens directory (#35768)
Moves the public api .d.ts files from tools/public_api_guard to goldens/public-api. Additionally, provides a README in the goldens directory and a script assist in testing the current state of the repo against the goldens as well as a command for accepting all changes to the goldens in a single command. PR Close #35768
This commit is contained in:

committed by
Matias Niemelä

parent
19cfaf7f4c
commit
15f8afa4bf
64
goldens/public-api/common/testing/testing.d.ts
vendored
Normal file
64
goldens/public-api/common/testing/testing.d.ts
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
export declare const MOCK_PLATFORM_LOCATION_CONFIG: InjectionToken<MockPlatformLocationConfig>;
|
||||
|
||||
export declare class MockLocationStrategy extends LocationStrategy {
|
||||
internalBaseHref: string;
|
||||
internalPath: string;
|
||||
internalTitle: string;
|
||||
urlChanges: string[];
|
||||
constructor();
|
||||
back(): void;
|
||||
forward(): void;
|
||||
getBaseHref(): string;
|
||||
getState(): unknown;
|
||||
onPopState(fn: (value: any) => void): void;
|
||||
path(includeHash?: boolean): string;
|
||||
prepareExternalUrl(internal: string): string;
|
||||
pushState(ctx: any, title: string, path: string, query: string): void;
|
||||
replaceState(ctx: any, title: string, path: string, query: string): void;
|
||||
simulatePopState(url: string): void;
|
||||
}
|
||||
|
||||
export declare class MockPlatformLocation implements PlatformLocation {
|
||||
get hash(): string;
|
||||
get hostname(): string;
|
||||
get href(): string;
|
||||
get pathname(): string;
|
||||
get port(): string;
|
||||
get protocol(): string;
|
||||
get search(): string;
|
||||
get state(): unknown;
|
||||
get url(): string;
|
||||
constructor(config?: MockPlatformLocationConfig);
|
||||
back(): void;
|
||||
forward(): void;
|
||||
getBaseHrefFromDOM(): string;
|
||||
getState(): unknown;
|
||||
onHashChange(fn: LocationChangeListener): void;
|
||||
onPopState(fn: LocationChangeListener): void;
|
||||
pushState(state: any, title: string, newUrl: string): void;
|
||||
replaceState(state: any, title: string, newUrl: string): void;
|
||||
}
|
||||
|
||||
export declare interface MockPlatformLocationConfig {
|
||||
appBaseHref?: string;
|
||||
startUrl?: string;
|
||||
}
|
||||
|
||||
export declare class SpyLocation implements Location {
|
||||
urlChanges: string[];
|
||||
back(): void;
|
||||
forward(): void;
|
||||
getState(): unknown;
|
||||
go(path: string, query?: string, state?: any): void;
|
||||
isCurrentPathEqualTo(path: string, query?: string): boolean;
|
||||
normalize(url: string): string;
|
||||
onUrlChange(fn: (url: string, state: unknown) => void): void;
|
||||
path(): string;
|
||||
prepareExternalUrl(url: string): string;
|
||||
replaceState(path: string, query?: string, state?: any): void;
|
||||
setBaseHref(url: string): void;
|
||||
setInitialPath(url: string): void;
|
||||
simulateHashChange(pathname: string): void;
|
||||
simulateUrlPop(pathname: string): void;
|
||||
subscribe(onNext: (value: any) => void, onThrow?: ((error: any) => void) | null, onReturn?: (() => void) | null): SubscriptionLike;
|
||||
}
|
Reference in New Issue
Block a user