通过在Linux上运行詹金斯测试angular2噶时错误 [英] Karma error when running angular2 tests via jenkins on linux

查看:165
本文介绍了通过在Linux上运行詹金斯测试angular2噶时错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的业力詹金斯运行我angular2单元测试时看到下面的错误。

I am seeing the following error when running my angular2 unit tests using karma with jenkins.

我的测试,通过在Linux上运行詹金斯测试时,运行正常,当我在我的本地机器(Windows)在运行它们,但是我碰到下面的错误。

My tests run fine when I run them on my local machine (windows), however when running the test via jenkins on linux I get the following error.

Missing error handler on `socket`.
TypeError: (msg || "").replace is not a function
at /home/hudson/.hudson/jobs/workspace/pjt/node_modules/karma/lib/reporter.js:45:23

我的测试是从来没有开始任何想法可能是导致此。我看了看善缘源$ C ​​$ C和我无法弄清楚,为什么会有一个问题。

My tests are never started any ideas what could be causing this. I took a look at the karma source code and I couldn't figure out why there would be a problem.

  return function (msg, indentation) {
// remove domain and timestamp from source files
// and resolve base path / absolute path urls into absolute path
msg = (msg || '').replace(URL_REGEXP, function (_, prefix, path, __, ___, line, ____, column) {
  if (prefix === 'base') {
    path = basePath + path
  }
  // more code here ...

我使用PhantomJS作为测试运行,以防万一,无论在本地和詹金斯是相关的。

I'm using PhantomJS as the test runner just in case that's relevant both locally and on jenkins.

我倒是AP preciate任何指针,以什么可能是问题。

I'd appreciate any pointers as to what may be the issue.

推荐答案

要回答这个我自己的问题。

To answer my own question on this.

原来,问题是我的人缘文件部分。

Turns out the problem was with my karma files section.

  { pattern: 'node_modules/rxjs/bundles/rx.js', included: true, watched: true }

对于RX模块的文件名是node_modules / rxjs /包/ Rx.js

在Linux是大小写敏感的,这是它的工作在Windows开发环境和失败构建的Linux服务器上的原因。

With linux being case sensitive this is the reason it worked on a windows dev environment and failed on the linux build server.

404消息为rx.js文件是在日志present,但我错过了很多其他的调试日志记录之中。

The 404 message for the rx.js file was present in the logs but I missed among a lot of other debug logging.

教训:)

这篇关于通过在Linux上运行詹金斯测试angular2噶时错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆