-
Notifications
You must be signed in to change notification settings - Fork 6.8k
build: enable automatic test module teardown #23176
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
build: enable automatic test module teardown #23176
Conversation
@@ -14,7 +14,9 @@ describe('AutocompleteHarnessExample', () => { | |||
let loader: HarnessLoader; | |||
|
|||
beforeAll(() => { | |||
TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting()); | |||
TestBed.initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), { | |||
teardown: {destroyAfterEach: true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also enable rethrowErrors
everywhere as well?
teardown: {destroyAfterEach: true} | |
teardown: {destroyAfterEach: true, rethrowErrors: true} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It default to rethrowing when destroyAfterEach
is enabled: https://github.com/angular/angular/blob/master/packages/core/testing/src/r3_test_bed.ts#L482
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I assume a lint rule enforcing the option is not reasonable because eventually this will be the default anyway.
Yeah, the idea is to potentially flip the default in v13. |
Angular 12.1.2 includes [opt-in automatic test module teardown](angular/angular#42566) which is similar to our logic of destroying the current fixture. These changes clean up our monkey patches and use the new option instead.
bf0c248
to
4df538c
Compare
Angular 12.1.2 includes [opt-in automatic test module teardown](angular/angular#42566) which is similar to our logic of destroying the current fixture. These changes clean up our monkey patches and use the new option instead. (cherry picked from commit d090617)
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Angular 12.1.2 includes opt-in automatic test module teardown which is similar to our logic of destroying the current fixture. These changes clean up our monkey patches and use the new option instead.