在竹子代理上运行karma-cli失败了

时间:2015-06-21 09:35:26

标签: karma-runner bamboo

我试图通过Bamboo tasks bash Command运行karma cli。

node_modules/karma-cli/bin/karma start config/karma.conf.js --single-run
...
node_modules/karma-cli/bin/karma: line 3: syntax error near unexpected token `('
node_modules/karma-cli/bin/karma: line 3: `var path = require('path');'

我也尝试过没有karma-cli,这也带来了一个错误:

node_modules/karma-cli/bin/karma start config/karma.conf.js --single-run
...
./node_modules/karma/bin/karma: line 3: syntax error near unexpected token `'../lib/cli''
./node_modules/karma/bin/karma: line 3: `require('../lib/cli').run();'

package.json(仅限单元测试部分):

"jasmine-core": "^2.1.3",
"jasmine-jquery": "^2.0.6",
"karma": "^0.12.28",
"karma-chrome-launcher": "^0.1.7",
"karma-coverage": "^0.2.7",
"karma-firefox-launcher": "^0.1.3",
"karma-jasmine": "^0.3.2",
"karma-jasmine-jquery": "^0.1.1",
"karma-junit-reporter": "^0.2.2",
"karma-ng-html2js-preprocessor": "^0.1.2",
"karma-ng-json2js-preprocessor": "^1.0.0",
"karma-phantomjs-launcher": "^0.1.4",
"karma-script-launcher": "^0.1.0",
"minimist": "^1.1.0",
"path": "0.4.9",
"phantomjs": "^1.9.16",

问题出在哪里? 此致,Max

1 个答案:

答案 0 :(得分:1)

答案:不要在Bamboo代理中运行 Bash 命令,但使用 node.js 插件

所以,node.js任务用

command: node_modules/karma-cli/bin/karma
arguments: start config/karma.conf.js --single-run

然后它工作正常。