Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
timbergus opened this issue Feb 14, 2019 · 9 comments
Closed
Labels

Comments

@timbergus
Copy link

🐛 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
@ankurkaushal360
Copy link

ankurkaushal360 commented Feb 18, 2019

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

@timbergus
Copy link
Author

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

@ankurkaushal360
Copy link

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

nokome added a commit to stencila/encoda that referenced this issue Apr 29, 2019
Temporary workaround for this branch
See jestjs/jest#7890
Related to a dependendency of jest.
nokome added a commit to stencila/encoda that referenced this issue Jul 31, 2019
Temporary workaround for this branch
See jestjs/jest#7890
Related to a dependendency of jest.
@SimenB
Copy link
Member

SimenB commented Aug 15, 2019

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

@SimenB SimenB closed this as completed Aug 15, 2019
@sergtimosh
Copy link

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

@SimenB
Copy link
Member

SimenB commented Feb 26, 2020

Yeah, fixed in #9567

@sergtimosh
Copy link

Yeah, fixed in #9567

I've just updated packages, but problem still persists

@SimenB
Copy link
Member

SimenB commented Feb 26, 2020

Fix is not released

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants