构建Jhispter 3.2应用程序时PhantomJS出错

时间:2016-05-24 09:19:44

标签: maven phantomjs jhipster

我的 Jhispter 3.2.0 应用程序(springboot + angularjs)运行时

mvn package -Pprod -Dmaven.test.skip=false

我在PhantomJS测试中遇到以下错误:

  [INFO] --------------------------------------
24-mai-2016 10:49:06    [INFO]          GULP TEST --NO-COLOR
24-mai-2016 10:49:06    [INFO] --------------------------------------
24-mai-2016 10:49:12    [10:49:12] Using gulpfile /home/bamboo-home/xml-data/build-dir/BAC2-BB-JOB1/gulpfile.js
24-mai-2016 10:49:12    [10:49:12] Finished 'wiredep:test' after 160 ms
24-mai-2016 10:49:12    [10:49:12] Starting 'test'...
24-mai-2016 10:49:16    24 05 2016 10:49:16.033:INFO [karma]: Karma v0.13.22 server started at http://localhost:9876/
24-mai-2016 10:49:16    24 05 2016 10:49:16.038:INFO [launcher]: Starting browser PhantomJS
24-mai-2016 10:49:17    24 05 2016 10:49:17.225:INFO [PhantomJS 2.1.1 (Linux 0.0.0)]: Connected on socket /#39xT4ekwBtS29U-sAAAA with id 54555652
24-mai-2016 10:49:17    PhantomJS 2.1.1 (Linux 0.0.0) ERROR
24-mai-2016 10:49:17      TypeError: undefined is not a function (evaluating 'angular.module('backTrocApp').component('jhiAlertError',jhiAlertError)')
24-mai-2016 10:49:17      at /home/bamboo-home/xml-data/build-dir/BAC2-BB-JOB1/src/main/webapp/app/components/alert/alert-error.directive.js:9
24-mai-2016 10:49:17    
24-mai-2016 10:49:17    PhantomJS 2.1.1 (Linux 0.0.0): Executed 0 of 0 ERROR (0.47 secs / 0 secs)
24-mai-2016 10:49:17    
24-mai-2016 10:49:17    PhantomJS 2.1.1 (Linux 0.0.0) ERROR
24-mai-2016 10:49:17      TypeError: undefined is not a function (evaluating 'angular.module('backTrocApp').component('jhiAlert',jhiAlert)')
24-mai-2016 10:49:17      at /home/bamboo-home/xml-data/build-dir/BAC2-BB-JOB1/src/main/webapp/app/components/alert/alert.directive.js:9
  24-mai-2016 10:49:17  
24-mai-2016 10:49:17    PhantomJS 2.1.1 (Linux 0.0.0): Executed 0 of 0 ERROR (0.475 secs / 0 secs)
24-mai-2016 10:49:17    Missing error handler on `socket`.
24-mai-2016 10:49:17    TypeError: Cannot read property '54555652' of null
24-mai-2016 10:49:17        at onBrowserComplete (/home/bamboo-home/xml-JOB1/node_modules/orchestrator/index.js:264:8)
24-mai-2016 10:49:17        at /home/bamboo-home/xml-data/build-dir/BAC2-BB-JOB1/node_modules/orchestrator/index.js:275:23
24-mai-2016 10:49:17        at finish (/home/bamboo-home/xml-data/build-dir/BAC2-BB-JOB1/node_modules/orchestrator/lib/runTask.js:21:8)
24-mai-2016 10:49:17        at Server.<anonymous> (/home/bamboo-home/xml-data/build-dir/BAC2-BB-JOB1/node_modules/karma/lib/server.js:347:9)
24-mai-2016 10:49:17        at Server.g (events.js:260:16)
24-mai-2016 10:49:17        at emitNone (events.js:72:20)
24-mai-2016 10:49:17        at Server.emit (events.js:166:7)
24-mai-2016 10:49:17        at emitCloseNT (net.js:1521:8)
 24-mai-2016 10:53:17       var suite = suites[browser.id];
24-mai-2016 10:53:17    TypeError: Cannot read property '54555652' of null
24-mai-2016 10:53:17    24 05 2016 10:53:17.782:WARN [PhantomJS 2.1.1 (Linux 0.0.0)]: Disconnected (1 times), because no message in 240000 ms.
24-mai-2016 10:53:17    [INFO] BUILD FAILURE

感谢您的帮助

2 个答案:

答案 0 :(得分:0)

请参阅此jhipster issue

正如您所说,您使用的是Jhipster v 3.1.0,这是在3.2.0中添加的,因此请尝试更新您的应用程序并重试。

最好的问候。

答案 1 :(得分:0)

最后我找到了原因,测试是以角度1.4运行并产生错误。

我不记得了,但对于 angular-ui-tree 插件,我将bower.json的角度更改为1.2.0而不是1.5.0

"resolutions": {
"angular": ">1.2.0"
}

一切正常(与angular-ui-tree相同),thx求助