refactor(core): use Partial<T> for MetadataOverride (#24103)
Allows to write: const fixture = TestBed .overridePipe(DisplayNamePipe, { set: { pure: false } }) .createComponent(MenuComponent); when you only want to set the `pure` metadata, instead of currently: const fixture = TestBed .overridePipe(DisplayNamePipe, { set: { name: 'displayName', pure: false } }) .createComponent(MenuComponent); which forces you to redefine the name of the pipe even if it is useless. Fixes #24102 PR Close #24103
This commit is contained in:

committed by
Matias Niemelä

parent
5a02ae2f84
commit
253f509493
6
tools/public_api_guard/core/testing.d.ts
vendored
6
tools/public_api_guard/core/testing.d.ts
vendored
@ -55,9 +55,9 @@ export declare class InjectSetupWrapper {
|
||||
|
||||
/** @experimental */
|
||||
export declare type MetadataOverride<T> = {
|
||||
add?: T;
|
||||
remove?: T;
|
||||
set?: T;
|
||||
add?: Partial<T>;
|
||||
remove?: Partial<T>;
|
||||
set?: Partial<T>;
|
||||
};
|
||||
|
||||
/** @experimental */
|
||||
|
Reference in New Issue
Block a user