Skip to content

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

Closed
@timbergus

Description

@timbergus

🐛 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions