()
| 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; |
no test coverage detected