MCPcopy Index your code
hub / github.com/angular/angular / destroyActiveFixtures

Method destroyActiveFixtures

packages/core/testing/src/test_bed.ts:785–806  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

783 }
784
785 private destroyActiveFixtures(): void {
786 let errorCount = 0;
787 this._activeFixtures.forEach((fixture) => {
788 try {
789 fixture.destroy();
790 } catch (e) {
791 errorCount++;
792 console.error('Error during cleanup of component', {
793 component: fixture.componentInstance,
794 stacktrace: e,
795 });
796 }
797 });
798 this._activeFixtures = [];
799
800 if (errorCount > 0 && this.shouldRethrowTeardownErrors()) {
801 throw Error(
802 `${errorCount} ${errorCount === 1 ? 'component' : 'components'} ` +
803 `threw errors during cleanup`,
804 );
805 }
806 }
807
808 shouldRethrowTeardownErrors(): boolean {
809 const instanceOptions = this._instanceTeardownOptions;

Callers 1

resetTestingModuleMethod · 0.95

Calls 5

ErrorInterface · 0.85
destroyMethod · 0.65
errorMethod · 0.65
forEachMethod · 0.45

Tested by

no test coverage detected