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
19 lines
376 B
TypeScript
19 lines
376 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google Inc. 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
|
|
*/
|
|
|
|
/**
|
|
* Type used for modifications to metadata
|
|
*
|
|
* @experimental
|
|
*/
|
|
export type MetadataOverride<T> = {
|
|
add?: Partial<T>,
|
|
remove?: Partial<T>,
|
|
set?: Partial<T>
|
|
};
|