feat(core): introduce TestBed.tick() (#60993)

This commit introduces the `TestBed.tick()` method that,
similarly to the `ApplicationRef.tick()`, synchronizes state
with the DOM. It can be used in unit tests to mimic framework's
logic executed in production applications. The `TestBed.tick()`
should be used instead of the removed `TestBed.flushEffects()`.

BREAKING CHANGE: the `TestBed.flushEffects()` was removed - use
the `TestBed.tick()` instead.

PR Close #60993
This commit is contained in:
Pawel Kozlowski
2025-04-24 11:56:55 +02:00
committed by Kristiyan Kostadinov
parent ccc5cc068f
commit d5fd7349fb
2 changed files with 0 additions and 22 deletions
-20
View File
@@ -152,13 +152,6 @@ export interface TestBed {
createComponent<T>(component: Type<T>): ComponentFixture<T>;
/**
* Execute any pending effects.
*
* @deprecated use `TestBed.tick()` instead
*/
flushEffects(): void;
/**
* Execute any pending work required to synchronize model to the UI.
*
@@ -398,10 +391,6 @@ export class TestBedImpl implements TestBed {
return TestBedImpl.INSTANCE.ngModule;
}
static flushEffects(): void {
return TestBedImpl.INSTANCE.flushEffects();
}
static tick(): void {
return TestBedImpl.INSTANCE.tick();
}
@@ -812,15 +801,6 @@ export class TestBedImpl implements TestBed {
}
}
/**
* Execute any pending effects.
*
* @deprecated use `TestBed.tick()` instead
*/
flushEffects(): void {
this.inject(EffectScheduler).flush();
}
/**
* Execute any pending work required to synchronize model to the UI.
*