Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ivy): rethrow event handler errors in tests #28707

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/core/testing/src/r3_test_bed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
Compiler,
Component,
Directive,
ErrorHandler,
Injector,
ModuleWithComponentFactories,
NgModule,
Expand Down Expand Up @@ -600,6 +601,7 @@ export class TestBedRender3 implements Injector, TestBed {
const providers = [
{provide: NgZone, useValue: ngZone},
{provide: Compiler, useFactory: () => new R3TestCompiler(this)},
{provide: ErrorHandler, useClass: R3TestErrorHandler},
...this._providers,
...this._providerOverrides,
];
Expand Down Expand Up @@ -813,3 +815,8 @@ class R3TestCompiler implements Compiler {
return meta && meta.id || undefined;
}
}

/** Error handler used for tests. Rethrows errors rather than logging them out. */
class R3TestErrorHandler extends ErrorHandler {
handleError(error: any) { throw error; }
}
4 changes: 4 additions & 0 deletions tools/material-ci/angular_material_test_blocklist.js
Original file line number Diff line number Diff line change
Expand Up @@ -1273,6 +1273,10 @@ window.testBlocklist = {
"error": "Error: Expected mat-slide-toggle-thumb-container to contain 'mat-dragging'.",
"notes": "Unknown"
},
"MatSlideToggle without forms custom action configuration should not change value on click when click action is noop": {
"error": "TypeError: this._inputElement is undefined",
"notes": "Unknown"
},
"MatDrawer methods should be able to open": {
"error": "Error: Expected 0 to be 1.",
"notes": "Unknown"
Expand Down