fix(ivy): ensure TestBed restores fields to the most original value (#32823)
PR Close #32823
This commit is contained in:

committed by
Andrew Kushnir

parent
a54adcaff0
commit
c8be987b40
@ -513,9 +513,9 @@ export class R3TestBedCompiler {
|
||||
}
|
||||
|
||||
restoreOriginalState(): void {
|
||||
for (const op of this.defCleanupOps) {
|
||||
op.def[op.field] = op.original;
|
||||
}
|
||||
// Process cleanup ops in reverse order so the field's original value is restored correctly (in
|
||||
// case there were multiple overrides for the same field).
|
||||
forEachRight(this.defCleanupOps, (op: CleanupOperation) => { op.def[op.field] = op.original; });
|
||||
// Restore initial component/directive/pipe defs
|
||||
this.initialNgDefs.forEach(
|
||||
(value: [string, PropertyDescriptor | undefined], type: Type<any>) => {
|
||||
|
Reference in New Issue
Block a user