2

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"
    ]
  }
Stephan Ahlf
  • 3,310
  • 5
  • 39
  • 68
Gil Birman
  • 35,242
  • 14
  • 75
  • 119

1 Answers1

2

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

Stephan Ahlf
  • 3,310
  • 5
  • 39
  • 68