NoopNgZone for unit tests #43549
Labels
area: testing
Issues related to Angular testing features, such as TestBed
area: zones
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Milestone
Which @angular/* package(s) are relevant/releated to the feature request?
core, platform-browser-dynamic
Description
The introduction of NoopNgZone a few years ago was awesome ❤️ . But it was never ported to unit tests.
There is no good reason why I want this other than my distaste in the implementation of zone.js. Rxjs + async pipe + Input push change detection is perfectly fine. There is no need for 60kb of monkeypatching half the environment IMO. Maybe nicer stack traces is a plus. Or being able to use any testrunner you want without the need of extra patches.
So feel free to close if this feature wont happen.
Proposed solution
Don't hardcode in the testing modules the assumption that Zone exists and allow the use of NoopNgZone
Alternatives considered
Our current solution is a file
angular-testing-noop-zone.ts
with contents:We use jest as a test runner and native async/await. As jest isn't officially supported by zone.js, you have to use the patch from jest-preset-angular or bake your own. The above file renders that patch obsolete as the environment is untouched by zone.js. jest just runs as intended.
The text was updated successfully, but these errors were encountered: