Javascript Jest测试失败”;TypeError:路径必须是字符串。收到未定义的“;
在导出到jest测试文件的任何es6/require()上出现此故障:Javascript Jest测试失败”;TypeError:路径必须是字符串。收到未定义的“;,javascript,node.js,unit-testing,jestjs,Javascript,Node.js,Unit Testing,Jestjs,在导出到jest测试文件的任何es6/require()上出现此故障: const path=require('path') 节点4.5.0,npm 2.15.9 Jest 19.0.0,babel Jest:21.2.0回答babel Jest和babel预置Jest版本。当我降低这个软件包的版本时,一切都很好 Fail src\util\datetime.test.js TypeError: Path must be a string. Rrecieved undefined at asse
const path=require('path')代码>
节点4.5.0,npm 2.15.9
Jest 19.0.0,babel Jest:21.2.0回答babel Jest
和babel预置Jest
版本。当我降低这个软件包的版本时,一切都很好
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)