jest-leak-detector
Advanced tools
Comparing version 29.7.0 to 30.0.0-alpha.1
@@ -1,9 +0,23 @@ | ||
'use strict'; | ||
/*! | ||
* /** | ||
* * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* * | ||
* * This source code is licensed under the MIT license found in the | ||
* * LICENSE file in the root directory of this source tree. | ||
* * / | ||
*/ | ||
/******/ (() => { // webpackBootstrap | ||
/******/ "use strict"; | ||
var __webpack_exports__ = {}; | ||
// This entry need to be wrapped in an IIFE because it uses a non-standard name for the exports (exports). | ||
(() => { | ||
var exports = __webpack_exports__; | ||
Object.defineProperty(exports, '__esModule', { | ||
Object.defineProperty(exports, "__esModule", ({ | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
})); | ||
exports["default"] = void 0; | ||
function _util() { | ||
const data = require('util'); | ||
const data = require("util"); | ||
_util = function () { | ||
@@ -15,3 +29,3 @@ return data; | ||
function _v() { | ||
const data = require('v8'); | ||
const data = require("v8"); | ||
_v = function () { | ||
@@ -23,3 +37,3 @@ return data; | ||
function _vm() { | ||
const data = require('vm'); | ||
const data = require("vm"); | ||
_vm = function () { | ||
@@ -31,3 +45,3 @@ return data; | ||
function _jestGetType() { | ||
const data = require('jest-get-type'); | ||
const data = require("jest-get-type"); | ||
_jestGetType = function () { | ||
@@ -39,3 +53,3 @@ return data; | ||
function _prettyFormat() { | ||
const data = require('pretty-format'); | ||
const data = require("pretty-format"); | ||
_prettyFormat = function () { | ||
@@ -60,10 +74,3 @@ return data; | ||
if ((0, _jestGetType().isPrimitive)(value)) { | ||
throw new TypeError( | ||
[ | ||
'Primitives cannot leak memory.', | ||
`You passed a ${typeof value}: <${(0, _prettyFormat().format)( | ||
value | ||
)}>` | ||
].join(' ') | ||
); | ||
throw new TypeError(['Primitives cannot leak memory.', `You passed a ${typeof value}: <${(0, _prettyFormat().format)(value)}>`].join(' ')); | ||
} | ||
@@ -88,6 +95,14 @@ | ||
} | ||
if (this._isReferenceBeingHeld) { | ||
// triggering a heap snapshot is more aggressive than just `global.gc()`, | ||
// but it's also quite slow, so only do it if we still think we're leaking. | ||
// https://github.com/nodejs/node/pull/48510#issuecomment-1719289759 | ||
(0, _v().getHeapSnapshot)(); | ||
for (let i = 0; i < 10; i++) { | ||
await tick(); | ||
} | ||
} | ||
return this._isReferenceBeingHeld; | ||
} | ||
_runGarbageCollector() { | ||
// @ts-expect-error: not a function on `globalThis` | ||
const isGarbageCollectorHidden = globalThis.gc == null; | ||
@@ -105,2 +120,7 @@ | ||
} | ||
exports.default = LeakDetector; | ||
exports["default"] = LeakDetector; | ||
})(); | ||
module.exports = __webpack_exports__; | ||
/******/ })() | ||
; |
{ | ||
"name": "jest-leak-detector", | ||
"version": "29.7.0", | ||
"version": "30.0.0-alpha.1", | ||
"repository": { | ||
@@ -15,2 +15,4 @@ "type": "git", | ||
"types": "./build/index.d.ts", | ||
"require": "./build/index.js", | ||
"import": "./build/index.mjs", | ||
"default": "./build/index.js" | ||
@@ -21,4 +23,4 @@ }, | ||
"dependencies": { | ||
"jest-get-type": "^29.6.3", | ||
"pretty-format": "^29.7.0" | ||
"jest-get-type": "30.0.0-alpha.1", | ||
"pretty-format": "30.0.0-alpha.1" | ||
}, | ||
@@ -29,3 +31,3 @@ "devDependencies": { | ||
"engines": { | ||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0" | ||
"node": "^16.10.0 || ^18.12.0 || >=20.0.0" | ||
}, | ||
@@ -35,3 +37,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630" | ||
"gitHead": "d005cb2505c041583e0c5636d006e08666a54b63" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 2 instances in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 2 instances in 1 package
6529
6
128
2
+ Added@jest/schemas@30.0.0-alpha.1(transitive)
+ Added@sinclair/typebox@0.31.28(transitive)
+ Addedjest-get-type@30.0.0-alpha.1(transitive)
+ Addedpretty-format@30.0.0-alpha.1(transitive)
- Removed@jest/schemas@29.6.3(transitive)
- Removed@sinclair/typebox@0.27.8(transitive)
- Removedjest-get-type@29.6.3(transitive)
- Removedpretty-format@29.7.0(transitive)
Updatedjest-get-type@30.0.0-alpha.1
Updatedpretty-format@30.0.0-alpha.1