TestBed: provide an option to treat a test as failed when an error is thrown in a listener #46213
Labels
comp: core
Runtime issues
comp: testing
feature
Issue that requests a new feature
hotlist: google
votes required
Milestone


Which @angular/* package(s) are relevant/related to the feature request?
core
Description
Currently, when a listener produces an error during the test execution, it doesn't affect the outcome of the test: the error is reported to the ErrorHandler and it logs it into the console. Here is a relevant part of code:
angular/packages/core/src/render3/instructions/listener.ts
Lines 228 to 240 in 6d1e6a8
Here is an example TesBed test:
Changing this behavior would be breaking, so we can consider adding a TestBed flag to force the test to fail in this case (and generally in any case when an error is reported to the ErrorHandler).
The text was updated successfully, but these errors were encountered: