用jenkins运行量angular器testing抛出“testing`标题”应该是一个“string”,但“function”被给予代替。

所以这是一个有点头痛的人。

如果我从Jenkins作业运行我们的量angular器e2etesting,则失败:

[10:23:53] I/local - Starting selenium standalone server... [10:23:53] I/launcher - Running 1 instances of WebDriver [10:23:54] I/local - Selenium standalone server started at http://10.0.0.5:43412/wd/hub [10:23:56] E/launcher - Error: Error: Test `title` should be a "string" but "function" was given instead. at new Test (/var/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_5.0.0/lib/node_modules/mocha/lib/test.js:24:11) at context.it.context.specify (/var/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_5.0.0/lib/node_modules/mocha/lib/interfaces/bdd.js:84:18) at /var/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_5.0.0/lib/node_modules/protractor/node_modules/selenium-webdriver/testing/index.js:95:14 at context.xit.context.xspecify.context.it.skip (/var/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_5.0.0/lib/node_modules/mocha/lib/interfaces/bdd.js:103:15) at Function.skip (/var/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_5.0.0/lib/node_modules/protractor/node_modules/selenium-webdriver/testing/index.js:98:14) at Suite.<anonymous> (/var/jenkins/workspace/vw3-predevelop-linux/src/Ui/dev/test/endToEnd/presetInteractions.scenario.js:87:8) at Object.create (/var/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_5.0.0/lib/node_modules/mocha/lib/interfaces/common.js:114:19) at context.describe.context.context (/var/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_5.0.0/lib/node_modules/mocha/lib/interfaces/bdd.js:42:27) at Object.<anonymous> (/var/jenkins/workspace/develop-linux/src/Ui/dev/test/endToEnd/presetInteractions.scenario.js:8:1) at Module._compile (module.js:425:26) [10:23:56] E/launcher - Process exited with error code 100 

但是,如果我使用相同版本的Node(5.0.0)和npm(3.3.6)作为Jenkins用户,使用相同的命令ssh到机器,testing运行得很好。 这是扔摩卡的地方: https : //github.com/mochajs/mocha/blob/master/lib/test.js#L24,但我不明白为什么它会是“不是一个string”jenkins运行testing,但是当我ssh进入时,还好。我也检查了我们的presetInteractions.scenario.js文件,但是它和我们其他任何量angular器文件没有什么不同,关于第8行毫无presetInteractions.scenario.js

 var Utils = require('./utils'); var chai = require('chai'); var chaiAsPromised = require('chai-as-promised'); chai.use(chaiAsPromised); var expect = chai.expect; describe('Preset interaction features', function() { before(function(done) { ... 

       

网上收集的解决方案 "用jenkins运行量angular器testing抛出“testing`标题”应该是一个“string”,但“function”被给予代替。"