【问题标题】:react unit testing with jest debug用笑话调试反应单元测试
【发布时间】:2017-08-04 04:56:54
【问题描述】:

我正在编写一些单元测试来使用 jest 进行反应,但它在某一时刻失败了。我想调试单元测试并尝试以下操作

https://facebook.github.io/jest/docs/troubleshooting.html

但是在第一次运行时本身

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

我收到以下错误

node_modules\.bin\jest:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list

有什么想法吗?

【问题讨论】:

    标签: reactjs debugging jestjs


    【解决方案1】:

    改为:

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

    试试这个:

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

    (或)

    node --inspect-brk ./node_modules/jest/bin/jest.js --runInBand

    【讨论】:

      【解决方案2】:

      看起来"$0" 应该是'$0'

      【讨论】:

      • 这是库生成的,我无法更改。
      猜你喜欢
      • 2018-03-23
      • 2015-10-17
      • 2019-03-25
      • 2022-01-07
      • 2021-04-25
      • 2021-08-27
      • 1970-01-01
      • 1970-01-01
      • 2015-06-28
      相关资源
      最近更新 更多