Gil Birman
Gil Birman

Reputation: 35900

How to use iron-node to debug jest unit tests?

To run my UTs I run the command:

BABEL_JEST_STAGE=0 jest

How can I use iron-node to debug my unit tests?

btw, my package.json has a standard jest configuration:

  "jest": {
    "scriptPreprocessor": "<rootDir>/node_modules/babel-jest",
    "testFileExtensions": [
      "es6",
      "js"
    ],
    "moduleFileExtensions": [
      "js",
      "json",
      "es6"
    ],
    "unmockedModulePathPatterns": [
      "react"
    ]
  }

Upvotes: 2

Views: 400

Answers (1)

Stephan Ahlf
Stephan Ahlf

Reputation: 3497

I recently wrote a doc about how to debug grunt tasks. With a good chance you can apply this technique to debug jest.

https://github.com/s-a/iron-node/blob/master/docs/DEBUG-NODEJS-COMMANDLINE-APPS.md

Upvotes: 2

Related Questions