【问题标题】:Jest test failed "TypeError: Path must be a string. Recieved undefined"开玩笑测试失败“TypeError:路径必须是字符串。收到未定义”
【发布时间】:2017-11-30 08:33:11
【问题描述】:

在任何 es6/require() 导出到 jest 测试文件时都失败了:

const path = require('path');

Fail src\util\datetime.test.js
TypeError: Path must be a string. Rrecieved undefined
at assertPath(path.js:8:11)
at Object.win32.relative(path.js:256:3)

节点 4.5.0,npm 2.15.9

Jest 19.0.0,babel-jest:21.2.0

【问题讨论】:

    标签: javascript node.js unit-testing jestjs


    【解决方案1】:

    babel-jestbabel-preset-jest 版本中回答。当我降低此软件包的版本时,一切正常

    【讨论】:

      猜你喜欢
      • 2018-10-13
      • 2018-02-23
      • 2019-06-04
      • 1970-01-01
      • 2016-04-29
      • 1970-01-01
      • 1970-01-01
      • 2016-10-13
      • 2021-09-08
      相关资源
      最近更新 更多