Description
Feature Description
As discussed today during the test harnesses community chat (AngularCommunity/angular-missions#5), it was noticed that @angular/cdk/testing
depends on @angular/core/testing
which depends on @angular/core
due to the following import:
The flush
function which is imported in order to handle fake async tests ends up importing @angular/core
.
(I think that ComponentFixture
isn't a problem because it is only used as a type so it's not bundled.)
The problem with this is that libraries like cypress-harness which depend on @angular/cdk/testing
end up loading @angular/core
and eventually slowing down tests as mentioned here jscutlery/devkit#6.
It's not just a performance issue but it feels wrong to always depend on @angular/core
just because fake async tests need flush
.
😅 It's too late in the evening for my brain to come up with precise suggestions... but I can hear some voices in my head:
- Dependency Inversion
- Move fake async to
@angular/core/testing/fake-async
or such - YOLO, Please Repeat Yourself (cc. @jeffwhelpley 😉):
_Zone && _Zone[_Zone.__symbol__('fakeAsyncTest')].flush()