From aa9dca4c3c323ebe4dc541f0b8c904acc4f75cf9 Mon Sep 17 00:00:00 2001 From: Yadd Date: Tue, 13 Sep 2022 17:20:32 +0200 Subject: [PATCH] Replace deprecated call to `__proto__` with `Object.setPrototypeOf` (#13256) --- CHANGELOG.md | 1 + packages/jest-haste-map/src/watchers/WatchmanWatcher.js | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f3776019161..c03a2274fc3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ ### Fixes +- `[jest-haste-map]` Remove `__proto__` usage ([#13256](https://github.com/facebook/jest/pull/13256)) - `[jest-mock]` Improve `spyOn` typings to handle optional properties ([#13247](https://github.com/facebook/jest/pull/13247)) ### Chore & Maintenance diff --git a/packages/jest-haste-map/src/watchers/WatchmanWatcher.js b/packages/jest-haste-map/src/watchers/WatchmanWatcher.js index c7f8791bf34b..69ef94afaf0f 100644 --- a/packages/jest-haste-map/src/watchers/WatchmanWatcher.js +++ b/packages/jest-haste-map/src/watchers/WatchmanWatcher.js @@ -34,8 +34,7 @@ export default function WatchmanWatcher(dir, opts) { this.init(); } -// eslint-disable-next-line no-proto -WatchmanWatcher.prototype.__proto__ = EventEmitter.prototype; +Object.setPrototypeOf(WatchmanWatcher.prototype, EventEmitter.prototype); /** * Run the watchman `watch` command on the root and subscribe to changes.