Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c243670

Browse files
thePunderWomanAndrewKushnir
authored andcommitted
fix(core): fixes test timer-based test flakiness in CI (#59674)
This converts two tests that rely on timers to use fakeAsync. This resolves the flakiness. PR Close #59674
1 parent 7dc5116 commit c243670

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎packages/platform-server/test/incremental_hydration_spec.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
withEventReplay,
3939
withIncrementalHydration,
4040
} from '@angular/platform-browser';
41-
import {TestBed} from '@angular/core/testing';
41+
import {fakeAsync, TestBed} from '@angular/core/testing';
4242
import {PLATFORM_BROWSER_ID} from '@angular/common/src/platform_id';
4343
import {DEHYDRATED_BLOCK_REGISTRY} from '@angular/core/src/defer/registry';
4444
import {JSACTION_BLOCK_ELEMENT_MAP} from '@angular/core/src/hydration/tokens';
@@ -1329,7 +1329,7 @@ describe('platform-server partial hydration integration', () => {
13291329
});
13301330

13311331
describe('timer', () => {
1332-
it('top level timer', async () => {
1332+
it('top level timer', fakeAsync(async () => {
13331333
@Component({
13341334
selector: 'app',
13351335
template: `
@@ -1399,9 +1399,9 @@ describe('platform-server partial hydration integration', () => {
13991399
appRef.tick();
14001400

14011401
expect(appHostNode.outerHTML).toContain('<span id="test">end</span>');
1402-
});
1402+
}));
14031403

1404-
it('nested timer', async () => {
1404+
it('nested timer', fakeAsync(async () => {
14051405
@Component({
14061406
selector: 'app',
14071407
template: `
@@ -1487,7 +1487,7 @@ describe('platform-server partial hydration integration', () => {
14871487
appRef.tick();
14881488

14891489
expect(appHostNode.outerHTML).toContain('<span id="test">end</span>');
1490-
});
1490+
}));
14911491
});
14921492

14931493
it('when', async () => {

0 commit comments

Comments
 (0)