I updated my angular application to Angular 13 and everything kept working fine. Then I updated RxJS from 6.6.0 to 7.4.0. After that some unittest failed.
Pseudo test:
it('should test some async', fakeAsync(() => {
component.form.control.get('control').setValue('value')
expect(component.somevalue).toBeNull();
tick(999);
fixture.detectChanges();
expect(component.somevalue).toBeNull();
tick(1);
fixture.detectChanges();
expect(component.somevalue).not.toBeNull();
}));
Pseudo code
form.control.get('control').valueChange.pipe(debounceTime(1000)).subscribe(x => this.someValue = x);
In the test the subscribe never gets a result so it seems debounceTime
never continues. Any idea how to solve this?
I'm using
"@angular-builders/jest": "^13.0.2",
"jest": "27.4.3",
"jest-preset-angular": "^11.0.1",