我从 Github 下载了该ng-boilerplate
应用程序,我正在通过它来帮助我了解 AngularJS 和测试。
我做的第一件事就是尝试了解 Karma 测试的工作原理。所以我在 Karma 文件夹中打开了一个命令提示符,然后输入:
karma start karma-unit.tpl.js
我希望返回完美的测试结果(因为我没有触及任何代码)。但是,相反,我收到此错误:
C:\Users\Imray\stuff\Angular JS\ng-boilerplate\karma\karma-unit.tpl.js:12
<% scripts.forEach( function ( file ) { %>'<%= file %>',
^
ERROR [config]: Invalid config file!
SyntaxError: Unexpected token <
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object.parseConfig (C:\Users\Imray\stuff\Angular JS\ng-boilerplate\node_modules\karma\lib\config.js:250:22)
at Object.exports.start (C:\Users\Imray\stuff\Angular JS\ng-boilerplate\node_modules\karma\lib\server.js:286:20)
at Object.exports.run (C:\Users\Imray\stuff\Angular JS\ng-boilerplate\node_modules\karma\lib\cli.js:229:25)
at requireCliAndRun (C:\Users\Imray\AppData\Roaming\npm\node_modules\karma-cli\bin\karma:24:16)
为什么会这样?我究竟做错了什么?