question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MacOS: Jest does not exit any more due to fsevents update

See original GitHub issue

🐛 Bug Report

Jest does not exit any longer after the tests are done on MacOS.

I tracked it down to the Update of fsevents@2.2.0. Not sure if it might be better to open an issue there, or if you can fix it on your end. (Edit: I created https://github.com/fsevents/fsevents/issues/345)

As a workaround, I added the following to my package.json (through yarn):

"resolutions": {
  "**/jest-haste-map/fsevents": "2.1.3"
}

(Edit: Note that this workaround will fail installing on Windows and Linux. If you have a lock file (yarn.lock or package-lock.json), you should be able to set the version of fsevents to 2.1.3 there, see https://github.com/facebook/jest/issues/10777#issuecomment-722270678 below)

To Reproduce

Steps to reproduce the behavior:

Just run jest - I could reproduce it in a minimal repository with just Jest and a single test file.

package.json

{
  "name": "foo",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "scripts": {
    "test": "jest"
  },
  "dependencies": {
    "jest": "^26.6.2"
  }
}

foo.test.js

describe('test', () => {
  it('test', () => {
    expect(true).toBe(true)
  })
})

Expected behavior

Jest should exit after the tests are done.

envinfo

  System:
    OS: macOS 10.15.7
    CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
  Binaries:
    Node: 12.16.3 - ~/.nvm/versions/node/v12.16.3/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v12.16.3/bin/npm
  npmPackages:
    jest: ^26.6.2 => 26.6.2 

I also reproduced this on Node 14.1.0 and 15.0.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:61
  • Comments:20 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
SimenBcommented, Nov 5, 2020

Fixed upstream in 2.2.1 👍

5reactions
clokcommented, Dec 15, 2020

Still an ongoing issue for me. Can confirm I see this on node v12 and v14 with jest@26.6.3

└─┬ jest@26.6.3
  └─┬ @jest/core@26.6.3
    └─┬ jest-haste-map@26.6.2
      └── fsevents@2.2.0 
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve npm install throwing fsevents warning on non ...
As the above error message states that fsevents is optional and it is skipped in installation process. You can run npm install --no-optional ......
Read more >
Error: `fsevents` unavailable (this watcher can only be used on ...
Hi there, I'm encoutring an error with Expo xde. everything was working ok ... but no chance since the error still exist with...
Read more >
chokidar - npm
Indicates whether the process should continue to run as long as files are being watched. If set to false when using fsevents to...
Read more >
pampapam2 - bkimminich/juice-shop - Gitter
hello, i am having some trouble accessing juiceshop. i receive a message when using npm start saying: [DEP0018] DeprecationWarning: Unhandled promise rejections ...
Read more >
Node.js – How to solve npm install throwing fsevents warning on ...
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\rea ... But, unlike what is mentioned there, I do not have any ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found