MCPcopy
hub / github.com/jestjs/jest / teardown

Function teardown

packages/jest-environment-jsdom-abstract/src/index.ts:177–196  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175 async setup(): Promise<void> {}
176
177 async teardown(): Promise<void> {
178 if (this.fakeTimers) {
179 this.fakeTimers.dispose();
180 }
181 if (this.fakeTimersModern) {
182 this.fakeTimersModern.dispose();
183 }
184 if (this.global != null) {
185 if (this.errorEventListener) {
186 this.global.removeEventListener('error', this.errorEventListener);
187 }
188 this.global.close();
189 }
190 this.errorEventListener = null;
191 // @ts-expect-error: this.global not allowed to be `null`
192 this.global = null;
193 this.dom = null;
194 this.fakeTimers = null;
195 this.fakeTimersModern = null;
196 }
197
198 exportConditions(): Array<string> {
199 return this._configuredExportConditions ?? this.customExportConditions;

Callers

nothing calls this directly

Calls 2

disposeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected