How do you debug Jest Tests?

后端 未结 5 1426
庸人自扰
庸人自扰 2020-12-09 17:57

I can\'t find any information on debugging my unit tests written with Jest.

How do you debug Jest Tests ?

5条回答
  •  没有蜡笔的小新
    2020-12-09 18:43

    Run

    node --debug-brk node_modules/.bin/jest
    

    in your project directory. It should start the node process paused an listening (usually at port 5858) for a debugger. Visual Studio Code is an example of a nice graphical debugger for node.js that can be used to connect to the listening node process.

提交回复
热议问题