jest-leak-detector
Module for verifying whether an object has been garbage collected or not.
Last updated 5 years ago by simenb .
MIT · Repository · Bugs · Original npm
$ cnpm install jest-leak-detector 
SYNC missed versions from official npm registry.

jest-leak-detector

Module for verifying whether an object has been garbage collected or not.

Internally creates a weak reference to the object, and forces garbage collection to happen. If the reference is gone, it meant no one else was pointing to the object.

Example

(async function () {
  let reference = {};
  let isLeaking;

  const detector = new LeakDetector(reference);

  // Reference is held in memory.
  isLeaking = await detector.isLeaking();
  console.log(isLeaking); // true

  // We destroy the only reference to the object.
  reference = null;

  // Reference is gone.
  isLeaking = await detector.isLeaking();
  console.log(isLeaking); // false
})();

Current Tags

  • 29.3.1                                ...           latest (3 years ago)
  • 29.0.0-alpha.6                                ...           next (3 years ago)

24 Versions

  • 29.3.1                                ...           3 years ago
  • 29.0.0-alpha.6                                ...           3 years ago
  • 29.2.1                                ...           3 years ago
  • 28.1.3                                ...           3 years ago
  • 28.0.0-alpha.9                                ...           3 years ago
  • 28.1.0                                ...           3 years ago
  • 28.0.0-alpha.7                                ...           3 years ago
  • 27.5.1                                ...           4 years ago
  • 27.4.6                                ...           4 years ago
  • 27.2.0                                ...           4 years ago
  • 27.1.0                                ...           4 years ago
  • 27.0.0-next.11                                ...           4 years ago
  • 27.0.6                                ...           4 years ago
  • 26.6.2                                ...           5 years ago
  • 26.4.2                                ...           5 years ago
  • 25.5.0                                ...           5 years ago
  • 21.3.0-beta.15                                ...           8 years ago
  • 26.0.1-alpha.0                                ...           5 years ago
  • 25.2.1-alpha.2                                ...           5 years ago
  • 24.2.0-alpha.0                                ...           6 years ago
  • 26.3.0                                ...           5 years ago
  • 22.4.3                                ...           7 years ago
  • 23.6.0                                ...           7 years ago
  • 24.9.0                                ...           6 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (2)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org