From 2fca8051dd4957fd3d7870f4ecfc7046f4c182c2 Mon Sep 17 00:00:00 2001 From: Andrew Makarov Date: Thu, 7 Feb 2019 12:13:28 +0300 Subject: [PATCH 1/8] before migration --- packages/jest-leak-detector/build/index.d.ts | 14 +++ .../jest-leak-detector/build/index.d.ts.map | 1 + packages/jest-leak-detector/build/index.js | 108 ++++++++++++++++++ packages/jest-leak-detector/build/index.ts_ | 72 ++++++++++++ 4 files changed, 195 insertions(+) create mode 100644 packages/jest-leak-detector/build/index.d.ts create mode 100644 packages/jest-leak-detector/build/index.d.ts.map create mode 100644 packages/jest-leak-detector/build/index.js create mode 100644 packages/jest-leak-detector/build/index.ts_ diff --git a/packages/jest-leak-detector/build/index.d.ts b/packages/jest-leak-detector/build/index.d.ts new file mode 100644 index 000000000000..4b47aa700ca7 --- /dev/null +++ b/packages/jest-leak-detector/build/index.d.ts @@ -0,0 +1,14 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +export default class { + _isReferenceBeingHeld: boolean; + constructor(value: any); + isLeaking(): boolean; + _runGarbageCollector(): void; + _isPrimitive(value: any): boolean; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/jest-leak-detector/build/index.d.ts.map b/packages/jest-leak-detector/build/index.d.ts.map new file mode 100644 index 000000000000..83e37cde6d10 --- /dev/null +++ b/packages/jest-leak-detector/build/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,CAAC,OAAO;IACZ,qBAAqB,EAAE,OAAO,CAAC;gBAEnB,KAAK,EAAE,GAAG;IAiCtB,SAAS,IAAI,OAAO;IAMpB,oBAAoB;IAapB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;CAGlC"} \ No newline at end of file diff --git a/packages/jest-leak-detector/build/index.js b/packages/jest-leak-detector/build/index.js new file mode 100644 index 000000000000..72c2184fb576 --- /dev/null +++ b/packages/jest-leak-detector/build/index.js @@ -0,0 +1,108 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +'use strict'; + +Object.defineProperty(exports, '__esModule', { + value: true +}); +exports.default = void 0; + +function _prettyFormat() { + const data = _interopRequireDefault(require('pretty-format')); + + _prettyFormat = function _prettyFormat() { + return data; + }; + + return data; +} + +function _v() { + const data = _interopRequireDefault(require('v8')); + + _v = function _v() { + return data; + }; + + return data; +} + +function _vm() { + const data = _interopRequireDefault(require('vm')); + + _vm = function _vm() { + return data; + }; + + return data; +} + +function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; +} + +class _default { + constructor(value) { + if (this._isPrimitive(value)) { + throw new TypeError( + [ + 'Primitives cannot leak memory.', + 'You passed a ' + + typeof value + + ': <' + + (0, _prettyFormat().default)(value) + + '>' + ].join(' ') + ); + } + + let weak; + + try { + // eslint-disable-next-line import/no-extraneous-dependencies + weak = require('weak'); + } catch (err) { + if (!err || err.code !== 'MODULE_NOT_FOUND') { + throw err; + } + + throw new Error( + 'The leaking detection mechanism requires the "weak" package to be installed and work. ' + + 'Please install it as a dependency on your main project' + ); + } + + weak(value, () => (this._isReferenceBeingHeld = false)); + this._isReferenceBeingHeld = true; // Ensure value is not leaked by the closure created by the "weak" callback. + + value = null; + } + + isLeaking() { + this._runGarbageCollector(); + + return this._isReferenceBeingHeld; + } + + _runGarbageCollector() { + const isGarbageCollectorHidden = !global.gc; // GC is usually hidden, so we have to expose it before running. + + _v().default.setFlagsFromString('--expose-gc'); + + _vm().default.runInNewContext('gc')(); // The GC was not initially exposed, so let's hide it again. + + if (isGarbageCollectorHidden) { + _v().default.setFlagsFromString('--no-expose-gc'); + } + } + + _isPrimitive(value) { + return value !== Object(value); + } +} + +exports.default = _default; diff --git a/packages/jest-leak-detector/build/index.ts_ b/packages/jest-leak-detector/build/index.ts_ new file mode 100644 index 000000000000..c5ad07ba7b02 --- /dev/null +++ b/packages/jest-leak-detector/build/index.ts_ @@ -0,0 +1,72 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +'use strict'; + +import prettyFormat from 'pretty-format'; +import v8 from 'v8'; +import vm from 'vm'; + +export default class { + _isReferenceBeingHeld: boolean; + + constructor(value: ?Object) { + if (this._isPrimitive(value)) { + throw new TypeError( + [ + 'Primitives cannot leak memory.', + 'You passed a ' + typeof value + ': <' + prettyFormat(value) + '>', + ].join(' '), + ); + } + + let weak; + + try { + // eslint-disable-next-line import/no-extraneous-dependencies + weak = require('weak'); + } catch (err) { + if (!err || err.code !== 'MODULE_NOT_FOUND') { + throw err; + } + + throw new Error( + 'The leaking detection mechanism requires the "weak" package to be installed and work. ' + + 'Please install it as a dependency on your main project', + ); + } + + weak(value, () => (this._isReferenceBeingHeld = false)); + this._isReferenceBeingHeld = true; + + // Ensure value is not leaked by the closure created by the "weak" callback. + value = null; + } + + isLeaking(): boolean { + this._runGarbageCollector(); + + return this._isReferenceBeingHeld; + } + + _runGarbageCollector() { + const isGarbageCollectorHidden = !global.gc; + + // GC is usually hidden, so we have to expose it before running. + v8.setFlagsFromString('--expose-gc'); + vm.runInNewContext('gc')(); + + // The GC was not initially exposed, so let's hide it again. + if (isGarbageCollectorHidden) { + v8.setFlagsFromString('--no-expose-gc'); + } + } + + _isPrimitive(value: any): boolean { + return value !== Object(value); + } +} From daade867a7effafb890f5fc7f9ce38a410e7887d Mon Sep 17 00:00:00 2001 From: Andrew Makarov Date: Thu, 7 Feb 2019 12:17:39 +0300 Subject: [PATCH 2/8] Migrate jest-leak-detector to TypeScript --- packages/jest-leak-detector/package.json | 1 + .../src/__tests__/{index.test.js => index.test.ts} | 10 +++++----- packages/jest-leak-detector/src/{index.js => index.ts} | 6 ++---- packages/jest-leak-detector/tsconfig.json | 7 +++++++ 4 files changed, 15 insertions(+), 9 deletions(-) rename packages/jest-leak-detector/src/__tests__/{index.test.js => index.test.ts} (96%) rename packages/jest-leak-detector/src/{index.js => index.ts} (93%) create mode 100644 packages/jest-leak-detector/tsconfig.json diff --git a/packages/jest-leak-detector/package.json b/packages/jest-leak-detector/package.json index 434f904dcf62..eaeb90409094 100644 --- a/packages/jest-leak-detector/package.json +++ b/packages/jest-leak-detector/package.json @@ -8,6 +8,7 @@ }, "license": "MIT", "main": "build/index.js", + "types": "build/index.d.ts", "dependencies": { "pretty-format": "^24.0.0" }, diff --git a/packages/jest-leak-detector/src/__tests__/index.test.js b/packages/jest-leak-detector/src/__tests__/index.test.ts similarity index 96% rename from packages/jest-leak-detector/src/__tests__/index.test.js rename to packages/jest-leak-detector/src/__tests__/index.test.ts index b4499ec20d2e..e55aa7c1c649 100644 --- a/packages/jest-leak-detector/src/__tests__/index.test.js +++ b/packages/jest-leak-detector/src/__tests__/index.test.ts @@ -34,7 +34,7 @@ it('does not show the GC if hidden', () => { it('does not hide the GC if visible', () => { const detector = new LeakDetector({}); - global.gc = () => {}; + global.gc = () => { }; detector.isLeaking(); expect(global.gc).toBeDefined(); }); @@ -56,8 +56,8 @@ it('correctly checks simple leaks', () => { it('tests different objects', () => { const refs = [ - function() {}, - () => {}, + function () { }, + () => { }, Object.create(null), [], /foo/g, @@ -73,8 +73,8 @@ it('tests different objects', () => { }); it('correctly checks more complex leaks', () => { - let ref1 = {}; - let ref2 = {}; + let ref1: any = {}; + let ref2: any = {}; // Create a circular dependency between ref1 and ref2. ref1.ref2 = ref2; diff --git a/packages/jest-leak-detector/src/index.js b/packages/jest-leak-detector/src/index.ts similarity index 93% rename from packages/jest-leak-detector/src/index.js rename to packages/jest-leak-detector/src/index.ts index d9e97788a406..205e159118a5 100644 --- a/packages/jest-leak-detector/src/index.js +++ b/packages/jest-leak-detector/src/index.ts @@ -3,8 +3,6 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - * - * @flow */ 'use strict'; @@ -16,7 +14,7 @@ import vm from 'vm'; export default class { _isReferenceBeingHeld: boolean; - constructor(value: ?Object) { + constructor(value: any) { if (this._isPrimitive(value)) { throw new TypeError( [ @@ -38,7 +36,7 @@ export default class { throw new Error( 'The leaking detection mechanism requires the "weak" package to be installed and work. ' + - 'Please install it as a dependency on your main project', + 'Please install it as a dependency on your main project', ); } diff --git a/packages/jest-leak-detector/tsconfig.json b/packages/jest-leak-detector/tsconfig.json new file mode 100644 index 000000000000..7bb06bce6d20 --- /dev/null +++ b/packages/jest-leak-detector/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "rootDir": "src", + "outDir": "build" + } +} From 4b26b29f02b5e68ebabc47e33b9517d572b91f1c Mon Sep 17 00:00:00 2001 From: Andrew Makarov Date: Thu, 7 Feb 2019 12:27:08 +0300 Subject: [PATCH 3/8] Code linting --- packages/jest-leak-detector/src/__tests__/index.test.ts | 6 +++--- packages/jest-leak-detector/src/index.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/jest-leak-detector/src/__tests__/index.test.ts b/packages/jest-leak-detector/src/__tests__/index.test.ts index e55aa7c1c649..188aaf4cf920 100644 --- a/packages/jest-leak-detector/src/__tests__/index.test.ts +++ b/packages/jest-leak-detector/src/__tests__/index.test.ts @@ -34,7 +34,7 @@ it('does not show the GC if hidden', () => { it('does not hide the GC if visible', () => { const detector = new LeakDetector({}); - global.gc = () => { }; + global.gc = () => {}; detector.isLeaking(); expect(global.gc).toBeDefined(); }); @@ -56,8 +56,8 @@ it('correctly checks simple leaks', () => { it('tests different objects', () => { const refs = [ - function () { }, - () => { }, + function() {}, + () => {}, Object.create(null), [], /foo/g, diff --git a/packages/jest-leak-detector/src/index.ts b/packages/jest-leak-detector/src/index.ts index 205e159118a5..f281c3ea4886 100644 --- a/packages/jest-leak-detector/src/index.ts +++ b/packages/jest-leak-detector/src/index.ts @@ -7,9 +7,9 @@ 'use strict'; -import prettyFormat from 'pretty-format'; import v8 from 'v8'; import vm from 'vm'; +import prettyFormat from 'pretty-format'; export default class { _isReferenceBeingHeld: boolean; @@ -36,7 +36,7 @@ export default class { throw new Error( 'The leaking detection mechanism requires the "weak" package to be installed and work. ' + - 'Please install it as a dependency on your main project', + 'Please install it as a dependency on your main project', ); } From cf36683cfc4d8a3ea9dee7d5e541e83aeb368484 Mon Sep 17 00:00:00 2001 From: Andrew Makarov Date: Thu, 7 Feb 2019 12:28:52 +0300 Subject: [PATCH 4/8] Update ChangeLog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db7f53290797..5057addc65dc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - `[diff-sequences]`: Migrate to Typescript ([#7820](https://github.com/facebook/jest/pull/7820)) - `[jest-get-type]`: Migrate to TypeScript ([#7818](https://github.com/facebook/jest/pull/7818)) - `[jest-regex-util]`: Migrate to TypeScript ([#7822](https://github.com/facebook/jest/pull/7822)) +- `[jest-leak-detector]`: Migrate to TypeScript ([#7825](https://github.com/facebook/jest/pull/7825)) ### Performance From 2b342c9a37f1a0f94e7be273868d24f1fcd50ce0 Mon Sep 17 00:00:00 2001 From: Andrew Makarov Date: Thu, 7 Feb 2019 12:35:39 +0300 Subject: [PATCH 5/8] Applied comments after the review --- packages/jest-leak-detector/src/index.ts | 6 ++---- packages/jest-leak-detector/tsconfig.json | 5 ++++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/jest-leak-detector/src/index.ts b/packages/jest-leak-detector/src/index.ts index f281c3ea4886..78b64453dd11 100644 --- a/packages/jest-leak-detector/src/index.ts +++ b/packages/jest-leak-detector/src/index.ts @@ -5,14 +5,12 @@ * LICENSE file in the root directory of this source tree. */ -'use strict'; - import v8 from 'v8'; import vm from 'vm'; import prettyFormat from 'pretty-format'; export default class { - _isReferenceBeingHeld: boolean; + private _isReferenceBeingHeld: boolean; constructor(value: any) { if (this._isPrimitive(value)) { @@ -53,7 +51,7 @@ export default class { return this._isReferenceBeingHeld; } - _runGarbageCollector() { + private _runGarbageCollector() { const isGarbageCollectorHidden = !global.gc; // GC is usually hidden, so we have to expose it before running. diff --git a/packages/jest-leak-detector/tsconfig.json b/packages/jest-leak-detector/tsconfig.json index 7bb06bce6d20..3e70b10372b1 100644 --- a/packages/jest-leak-detector/tsconfig.json +++ b/packages/jest-leak-detector/tsconfig.json @@ -3,5 +3,8 @@ "compilerOptions": { "rootDir": "src", "outDir": "build" - } + }, + "references": [ + {"path": "../pretty-format"} + ] } From 55ef0f7251f63015163a804996908f04d05faf76 Mon Sep 17 00:00:00 2001 From: Andrew Makarov Date: Thu, 7 Feb 2019 12:40:24 +0300 Subject: [PATCH 6/8] Cleanup --- packages/jest-leak-detector/build/index.d.ts | 14 --- .../jest-leak-detector/build/index.d.ts.map | 1 - packages/jest-leak-detector/build/index.js | 108 ------------------ packages/jest-leak-detector/build/index.ts_ | 72 ------------ ...{index.test.js.snap => index.test.ts.snap} | 0 packages/jest-leak-detector/src/index.ts | 2 +- 6 files changed, 1 insertion(+), 196 deletions(-) delete mode 100644 packages/jest-leak-detector/build/index.d.ts delete mode 100644 packages/jest-leak-detector/build/index.d.ts.map delete mode 100644 packages/jest-leak-detector/build/index.js delete mode 100644 packages/jest-leak-detector/build/index.ts_ rename packages/jest-leak-detector/src/__tests__/__snapshots__/{index.test.js.snap => index.test.ts.snap} (100%) diff --git a/packages/jest-leak-detector/build/index.d.ts b/packages/jest-leak-detector/build/index.d.ts deleted file mode 100644 index 4b47aa700ca7..000000000000 --- a/packages/jest-leak-detector/build/index.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -export default class { - _isReferenceBeingHeld: boolean; - constructor(value: any); - isLeaking(): boolean; - _runGarbageCollector(): void; - _isPrimitive(value: any): boolean; -} -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/packages/jest-leak-detector/build/index.d.ts.map b/packages/jest-leak-detector/build/index.d.ts.map deleted file mode 100644 index 83e37cde6d10..000000000000 --- a/packages/jest-leak-detector/build/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,MAAM,CAAC,OAAO;IACZ,qBAAqB,EAAE,OAAO,CAAC;gBAEnB,KAAK,EAAE,GAAG;IAiCtB,SAAS,IAAI,OAAO;IAMpB,oBAAoB;IAapB,YAAY,CAAC,KAAK,EAAE,GAAG,GAAG,OAAO;CAGlC"} \ No newline at end of file diff --git a/packages/jest-leak-detector/build/index.js b/packages/jest-leak-detector/build/index.js deleted file mode 100644 index 72c2184fb576..000000000000 --- a/packages/jest-leak-detector/build/index.js +++ /dev/null @@ -1,108 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ -'use strict'; - -Object.defineProperty(exports, '__esModule', { - value: true -}); -exports.default = void 0; - -function _prettyFormat() { - const data = _interopRequireDefault(require('pretty-format')); - - _prettyFormat = function _prettyFormat() { - return data; - }; - - return data; -} - -function _v() { - const data = _interopRequireDefault(require('v8')); - - _v = function _v() { - return data; - }; - - return data; -} - -function _vm() { - const data = _interopRequireDefault(require('vm')); - - _vm = function _vm() { - return data; - }; - - return data; -} - -function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : {default: obj}; -} - -class _default { - constructor(value) { - if (this._isPrimitive(value)) { - throw new TypeError( - [ - 'Primitives cannot leak memory.', - 'You passed a ' + - typeof value + - ': <' + - (0, _prettyFormat().default)(value) + - '>' - ].join(' ') - ); - } - - let weak; - - try { - // eslint-disable-next-line import/no-extraneous-dependencies - weak = require('weak'); - } catch (err) { - if (!err || err.code !== 'MODULE_NOT_FOUND') { - throw err; - } - - throw new Error( - 'The leaking detection mechanism requires the "weak" package to be installed and work. ' + - 'Please install it as a dependency on your main project' - ); - } - - weak(value, () => (this._isReferenceBeingHeld = false)); - this._isReferenceBeingHeld = true; // Ensure value is not leaked by the closure created by the "weak" callback. - - value = null; - } - - isLeaking() { - this._runGarbageCollector(); - - return this._isReferenceBeingHeld; - } - - _runGarbageCollector() { - const isGarbageCollectorHidden = !global.gc; // GC is usually hidden, so we have to expose it before running. - - _v().default.setFlagsFromString('--expose-gc'); - - _vm().default.runInNewContext('gc')(); // The GC was not initially exposed, so let's hide it again. - - if (isGarbageCollectorHidden) { - _v().default.setFlagsFromString('--no-expose-gc'); - } - } - - _isPrimitive(value) { - return value !== Object(value); - } -} - -exports.default = _default; diff --git a/packages/jest-leak-detector/build/index.ts_ b/packages/jest-leak-detector/build/index.ts_ deleted file mode 100644 index c5ad07ba7b02..000000000000 --- a/packages/jest-leak-detector/build/index.ts_ +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -'use strict'; - -import prettyFormat from 'pretty-format'; -import v8 from 'v8'; -import vm from 'vm'; - -export default class { - _isReferenceBeingHeld: boolean; - - constructor(value: ?Object) { - if (this._isPrimitive(value)) { - throw new TypeError( - [ - 'Primitives cannot leak memory.', - 'You passed a ' + typeof value + ': <' + prettyFormat(value) + '>', - ].join(' '), - ); - } - - let weak; - - try { - // eslint-disable-next-line import/no-extraneous-dependencies - weak = require('weak'); - } catch (err) { - if (!err || err.code !== 'MODULE_NOT_FOUND') { - throw err; - } - - throw new Error( - 'The leaking detection mechanism requires the "weak" package to be installed and work. ' + - 'Please install it as a dependency on your main project', - ); - } - - weak(value, () => (this._isReferenceBeingHeld = false)); - this._isReferenceBeingHeld = true; - - // Ensure value is not leaked by the closure created by the "weak" callback. - value = null; - } - - isLeaking(): boolean { - this._runGarbageCollector(); - - return this._isReferenceBeingHeld; - } - - _runGarbageCollector() { - const isGarbageCollectorHidden = !global.gc; - - // GC is usually hidden, so we have to expose it before running. - v8.setFlagsFromString('--expose-gc'); - vm.runInNewContext('gc')(); - - // The GC was not initially exposed, so let's hide it again. - if (isGarbageCollectorHidden) { - v8.setFlagsFromString('--no-expose-gc'); - } - } - - _isPrimitive(value: any): boolean { - return value !== Object(value); - } -} diff --git a/packages/jest-leak-detector/src/__tests__/__snapshots__/index.test.js.snap b/packages/jest-leak-detector/src/__tests__/__snapshots__/index.test.ts.snap similarity index 100% rename from packages/jest-leak-detector/src/__tests__/__snapshots__/index.test.js.snap rename to packages/jest-leak-detector/src/__tests__/__snapshots__/index.test.ts.snap diff --git a/packages/jest-leak-detector/src/index.ts b/packages/jest-leak-detector/src/index.ts index 78b64453dd11..912bcdf00381 100644 --- a/packages/jest-leak-detector/src/index.ts +++ b/packages/jest-leak-detector/src/index.ts @@ -64,7 +64,7 @@ export default class { } } - _isPrimitive(value: any): boolean { + private _isPrimitive(value: any): boolean { return value !== Object(value); } } From 0efc5c9c6398cd4b65a649c027d4fa3b65687a9d Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 7 Feb 2019 13:54:45 +0300 Subject: [PATCH 7/8] Update packages/jest-leak-detector/src/index.ts Co-Authored-By: r3nya --- packages/jest-leak-detector/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jest-leak-detector/src/index.ts b/packages/jest-leak-detector/src/index.ts index 912bcdf00381..feff4b1e4f7b 100644 --- a/packages/jest-leak-detector/src/index.ts +++ b/packages/jest-leak-detector/src/index.ts @@ -64,7 +64,7 @@ export default class { } } - private _isPrimitive(value: any): boolean { + private _isPrimitive(value: unknown): boolean { return value !== Object(value); } } From 5ef1162471fcb615de2875d53301f575cd6bfe90 Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Thu, 7 Feb 2019 13:54:51 +0300 Subject: [PATCH 8/8] Update packages/jest-leak-detector/src/index.ts Co-Authored-By: r3nya --- packages/jest-leak-detector/src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jest-leak-detector/src/index.ts b/packages/jest-leak-detector/src/index.ts index feff4b1e4f7b..007b907fad6e 100644 --- a/packages/jest-leak-detector/src/index.ts +++ b/packages/jest-leak-detector/src/index.ts @@ -12,7 +12,7 @@ import prettyFormat from 'pretty-format'; export default class { private _isReferenceBeingHeld: boolean; - constructor(value: any) { + constructor(value: unknown) { if (this._isPrimitive(value)) { throw new TypeError( [