API reference › @evolu/common › LeakDetector › TestLeakDetector
Defined in: packages/common/src/LeakDetector.ts:121
Test LeakDetector with deterministic collection.
See
Extends
Properties
collect
readonly collect: () => number;
Defined in: packages/common/src/LeakDetector.ts:128
Simulates garbage collection of all tracked targets.
Reports every tracked handle that is still held and clears tracking. Returns the number of reported leaks.
getTrackedCount
readonly getTrackedCount: (options?: {
name?: string;
}) => number;
Defined in: packages/common/src/LeakDetector.ts:131
Returns the number of currently tracked targets.
track
readonly track: (target: object, leak: Leak, unregisterToken: object) => void;
Defined in: packages/common/src/LeakDetector.ts:35
Starts tracking target until untrack or
garbage collection.
When target is garbage-collected and Leak.isLeaked returns true,
the leak is reported with the stack captured at this call. The leak must
not reference target, or the target would never become unreachable.
Inherited from
untrack
readonly untrack: (unregisterToken: object) => void;
Defined in: packages/common/src/LeakDetector.ts:38
Stops tracking the target registered with unregisterToken.