Jest: Jest notify option error "Jest did not exit..." and no coverage summary

Created on 14 Feb 2019  路  8Comments  路  Source: facebook/jest

馃悰 Bug Report

I have updated recently to [email protected]__ and using my old config file appears the following error:

Jest did not exit one second after the test run has completed.
This usually means that there are asynchronous operations that weren't stopped in your tests. Consider running Jest with '--detectOpenHandles' to troubleshoot this issue.

This error disappears when removing the notify option from the configuration file.

To Reproduce

Install [email protected]__, create a simple test file true.test.js:

test('True to be true!', () => expect(true).toBe(true));

Create a jest.config.js file and add this content:

module.exports = {
  notify: true,
};

Run Jest from the __package.json__ test script:

{
  "scripts": {
    "test": "jest"
  }
}

Expected behavior

I expect to obtain notification when finished (appers, but long after finished), and a clean output with the coverage summary. Instead, I obtain the error message. And when removing the notification option, I obtain a clean output, but no coverage summary (not sure if the missing summary is related, but both appear at the same time).

This is the output with [email protected]__, same error, and no coverage summary:

screenshot 2019-02-14 11 45 00

This is the output with [email protected]__, same error, but with the coverage summary:

screenshot 2019-02-14 11 34 24

This is the output with [email protected]__, no error and coverage summary (but I needed to add testURL: 'http://localhost/' to the config file to pass the tests):

screenshot 2019-02-14 11 30 27

Link to GitHub repo

jest-bug. Please, just clone the repo, npm install and npm test.

Thanks a lot for your help.

Run npx envinfo --preset jest

System:
    OS: macOS 10.14.3
    CPU: (4) x64 Intel(R) Core(TM) i7-6660U CPU @ 2.40GHz
  Binaries:
    Node: 11.9.0 - /usr/local/bin/node
    Yarn: 1.13.0 - /usr/local/bin/yarn
    npm: 6.7.0 - /usr/local/bin/npm
  npmPackages:
    jest: ^24.1.0 => 24.1.0
Bug

Most helpful comment

This should be fixed after the change in node-notifier was reverted in 5.4.1. Update your lockfile and you should be good

All 8 comments

I am having the same issue as well. I have tried removing & adding the flag & the error only appears when the flag is present.

OK. It seems that the coverage summary is not an error. It has stopped being automatic. Now it's needed to be configured in coverageReporters option.

{
  coverageReporters: ['text-summary'],
}

And for now, the timeout problem can be avoided using jest --detectOpenHandles. This is the result with the new configuration using [email protected]__.

screenshot 2019-02-18 11 58 43

I still think the issue with --notify is a bug & using --detectOpenHandles would be a band aid solution.

This should be fixed after the change in node-notifier was reverted in 5.4.1. Update your lockfile and you should be good

It reproduces for me with "node-notifier": "^6.0.0"

Yeah, fixed in #9567

Yeah, fixed in #9567

I've just updated packages, but problem still persists

Fix is not released

Was this page helpful?
0 / 5 - 0 ratings