[Bug]: fakeAsync
and tick
seem to be not working with compileComponents
and DOM interactions
#2682
Labels
fakeAsync
and tick
seem to be not working with compileComponents
and DOM interactions
#2682
Version
14.2.2
Steps to reproduce
fake-async-jest
jest
The minimal reproduction example contains one component, which renders a text upon clicking a button. It does so by subscribing to an observable, which is delayed by using the RxJS
delay
operator:In a real application this observable could come from a service.
Under certain conditions (see "Actual behavior"), a test using
fakeAsync
andtick
fails unexpectedly:The spec file contains more tests for the same functionality, demonstrating under which exact conditions the test fails.
Expected behavior
The test passes when using
Jest
Actual behavior
If we are
Jest
instead ofJasmine
andKarma
andcompileComponents
in the test setup andTestBed.createComponent
outside offakeAsync
anddelay
to the Observable inside our component andfakeAsync
andtick
do not seem to work and the test fails unexpectedly.Additional context
To verify that the exact same test which fails unexpectedly using
Jest
passes when usingJasmine
andKarma
, you can check out the branchfake-async-jasmine
in the abovementioned repository.Environment
The text was updated successfully, but these errors were encountered: