MCPcopy
hub / github.com/testing-library/react-hooks-testing-library / cleanup

Function cleanup

src/core/cleanup.ts:5–10  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3let cleanupCallbacks: Array<CleanupCallback> = []
4
5async function cleanup() {
6 for (const callback of cleanupCallbacks) {
7 await callback()
8 }
9 cleanupCallbacks = []
10}
11
12function addCleanup(callback: CleanupCallback) {
13 cleanupCallbacks = [callback, ...cleanupCallbacks]

Callers 2

autoRegisterCleanupFunction · 0.85
cleanup.test.tsFile · 0.85

Calls 1

callbackFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…