javascript - Windows 7 上的 Istanbul 尔 Jasmine Node 问题

标签 javascript node.js unit-testing istanbul jasmine-node

尝试使用 jasmine-node 运行 Istanbul 尔

Running: node C:\myproject\project1\node_modules.bin\jasmine-node.CMD test No coverage information was collected, exit without writing coverage information C:\myproject\project1\merg\node_modules.bin\jasmine-node.CMD:1 (function (exports, require, module, __filename, __dirname) { @IF EXIST "%~dp0\node.exe" ( ^ SyntaxError: Invalid or unexpected token at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:528:28) at Object.Module._extensions..js (module.js:565:10) at Object.Module._extensions.(anonymous function) [as .js] (C:\myproject\project1\merg\node_modules\istanbul\lib\hook.js:109:37) at Module.load (module.js:473:32) at tryModuleLoad (module.js:432:12) at Function.Module._load (module.js:424:3) at Function.Module.runMain (module.js:590:10) at runFn (C:\myproject\project1\merg\node_modules\istanbul\lib\command\common\run-with-cover.js:122:16) at C:\myproject\project1\merg\node_modules\istanbul\lib\command\common\run-with-cover.js:251:17

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\itsme\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "test-cov" npm ERR! node v6.6.0 npm ERR! npm v3.10.7 npm ERR! code ELIFECYCLE npm ERR! Merg@0.4.0 test-cov: istanbul cover --report cobertura --include-all-sources jasmine-node test npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the Merg@0.4.0 test-cov script 'istanbul cover --report cobertura --include-all-sources jasmine-node test'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the Merg package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! istanbul cover --report cobertura --include-all-sources jasmine-node test npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs Merg npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls Merg npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! C:\myproject\project1\merg\npm-debug.log

最佳答案

尝试“node_modules/mocha/bin/_mocha”而不是“_mocha”

关于javascript - Windows 7 上的 Istanbul 尔 Jasmine Node 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39568617/

相关文章:

java - 用 @MockBean 模拟的 RestTemplateBuilder 为 null

java - 使用 Mockito 根据调用时间更改模拟对象行为?

javascript - 触发事件的文本字段上的 Selenium,一种模仿人类交互的方式

javascript - 尽管设备像素比固定图像大小

c# - 将基于 JS 的可视化库与 C#/Linq 集合一起使用

javascript - 'this'关键字如何在函数调用中解析

node.js - Mongoose 仍然通过选择 : false 发送密码字段

javascript - 将使用 'passport' 创建的 javascript var 传输到 Express 路由器

node.js - 使用 Nodejs 和 Sequelize 进行 Promise

c++ - QT 测试 - 变量/对象失去值(value)