Socket
Socket
Sign inDemoInstall

jest-leak-detector

Package Overview
Dependencies
5
Maintainers
5
Versions
165
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jest-leak-detector

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


Version published
Weekly downloads
22M
decreased by-1.93%
Maintainers
5
Install size
127 kB
Created
Weekly downloads
 

Changelog

Source

27.1.0

Features

  • [jest-haste-map] Use watchman suffix-set option for faster file indexing. (#11784)
  • [jest-cli] Adds a new config options snapshotFormat which offers a way to override any of the formatting settings which come with pretty-format. (#11654)
  • [jest-reporters] Expose the getSummary util (#11695).
  • [jest-resolver] Support node: prefix when importing Node core modules (#11331)

Fixes

  • [jest-each] Relaxed the validation to allow multibyte characters in headings (#11575)
  • [jest-environment-jsdom] Add support for userAgent option (#11773)
  • [jest-environment-node] Add Event and EventTarget to node global environment. (#11727)
  • [jest-mock] Fix spyOn to use Object.prototype.hasOwnProperty (#11721)
  • [jest-resolver] Add dependency on jest-haste-map (#11759)
  • [jest-types] Compat with @types/node v16 (#11645)

Chore & Maintenance

  • [docs] Correct expects.assertions documentation by adding async/await for asynchronous function.

Readme

Source

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
})();

FAQs

Last updated on 27 Aug 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc