Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Jest测试失败”;TypeError:路径必须是字符串。收到未定义的“;_Javascript_Node.js_Unit Testing_Jestjs - Fatal编程技术网

Javascript Jest测试失败”;TypeError:路径必须是字符串。收到未定义的“;

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

在导出到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 assertPath(path.js:8:11)
at Object.win32.relative(path.js:256:3)