Jitjs测试在Gitlab CI中失败

时间:2017-06-12 13:39:45

标签: jestjs gitlab-ci

我试图在Gitlab CI中运行Jest测试。 测试在本地成功,但是当我在Gitlab CI上运行时,我收到以下错误:

Test suite failed to run
ProcessTerminatedError: cancel after 2 retries!

  at Farm.<anonymous> (node_modules/worker-farm/lib/farm.js:81:25)
  at Array.forEach (native)
  at Farm.<anonymous> (node_modules/worker-farm/lib/farm.js:75:36)
  at ontimeout (timers.js:386:14)
  at tryOnTimeout (timers.js:250:5)
  at Timer.listOnTimeout (timers.js:214:5)

A worker process has quit unexpectedly! Most likely this is an 
initialization error.
error Command failed with exit code 1.

我尝试添加--runInBand选项,但这会导致分段错误。我也尝试了--maxWorkers选项,但这导致了同样的错误。有任何想法如何解决这个问题?

1 个答案:

答案 0 :(得分:1)

我解决了这个问题。在我的情况下问题不是Jest本身,但是使用canvas-prebuilt我仍然不确定问题是什么,但我用canvas npm包替换了canvas-prebuilt并安装了所需的包。现在一切正常。