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 crashes and doesn't run afterEach when an assertion fails within a child_process.exec asynchronous test #1897

Closed
evansiroky opened this issue Oct 7, 2016 · 2 comments

Comments

@evansiroky
Copy link

What is the current behavior?

Jest crashes and doesn't run afterEach when an assertion fails within a child_process.exec asynchronous test

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal repository on GitHub that we can npm install and npm test.

See repository: https://github.com/evansiroky/jest-exec-bug

What is the expected behavior?

Test should fail, but Jest shouldn't crash. Also, afterEach should be ran.

Run Jest again with --debug and provide the full configuration it prints. Please mention your node and npm version and operating system.

> [email protected] test /Users/evansiroky/git/jest-exec-bug
> jest "--debug"

jest version = 16.0.1
test framework = jasmine2
config = {
  "rootDir": "/Users/evansiroky/git/jest-exec-bug",
  "name": "-Users-evansiroky-git-jest-exec-bug",
  "setupFiles": [],
  "testRunner": "/Users/evansiroky/git/jest-exec-bug/node_modules/jest-jasmine2/build/index.js",
  "scriptPreprocessor": "/Users/evansiroky/git/jest-exec-bug/node_modules/babel-jest/build/index.js",
  "usesBabelJest": true,
  "automock": false,
  "bail": false,
  "browser": false,
  "cacheDirectory": "/var/folders/r0/mcwl0yfn33bg7qvzw5z7gv800000gn/T/jest",
  "clearMocks": false,
  "coveragePathIgnorePatterns": [
    "/node_modules/"
  ],
  "coverageReporters": [
    "json",
    "text",
    "lcov",
    "clover"
  ],
  "globals": {},
  "haste": {
    "providesModuleNodeModules": []
  },
  "mocksPattern": "__mocks__",
  "moduleDirectories": [
    "node_modules"
  ],
  "moduleFileExtensions": [
    "js",
    "json",
    "jsx",
    "node"
  ],
  "moduleNameMapper": {},
  "modulePathIgnorePatterns": [],
  "noStackTrace": false,
  "notify": false,
  "preset": null,
  "preprocessorIgnorePatterns": [
    "/node_modules/"
  ],
  "resetModules": false,
  "testEnvironment": "jest-environment-jsdom",
  "testPathDirs": [
    "/Users/evansiroky/git/jest-exec-bug"
  ],
  "testPathIgnorePatterns": [
    "/node_modules/"
  ],
  "testRegex": "(/__tests__/.*|\\.(test|spec))\\.jsx?$",
  "testURL": "about:blank",
  "timers": "real",
  "useStderr": false,
  "verbose": null,
  "watch": false,
  "cache": true,
  "watchman": true,
  "testcheckOptions": {
    "times": 100,
    "maxSize": 200
  }
}

node 6.5.0
npm 3.10.3

@thymikee
Copy link
Collaborator

thymikee commented Dec 8, 2016

It's a known bug, where unhandled async errors crash Jest, moving discussion here #2059

@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 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants