zoukankan      html  css  js  c++  java
  • 使用VSCode调试Jest

    0. 环境

    Node版本:8.12.0
    操作系统:windows10

    1. 配置launch.json

    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Debug Jest Tests",
                "type": "node",
                "request": "launch",
                "runtimeArgs": [
                    "--inspect-brk",
                    "${workspaceRoot}/node_modules/.bin/jest",
                    "--runInBand"
                ],
                "console": "integratedTerminal",
                "internalConsoleOptions": "neverOpen",
                "port": "9229"
            }
        ]
    }
    

    2. package.json里添加代码

    "scripts": {
        "debugger": "node --inspect-brk ./node_modules/jest/bin/jest --runInBand --no-cache --no-watchman"
    }
    

    3. 启动Jest调试

    执行代码

    npm run debugger
    

    4. 打断点调试

    通过鼠标,或者通过Ctrl+Shift+D进入VSCode的调试面板。
    点击调试即可。

  • 相关阅读:
    自己建二维obj
    微信webview
    闭包
    angular
    2015项目timeline
    项目总结
    aa
    AHA高级心血管生命支持ACLS课前自我评估测试
    BASH_SOURCE
    bootstrap--小李子demo
  • 原文地址:https://www.cnblogs.com/samwu/p/9677562.html
Copyright © 2011-2022 走看看