在CircleCI上运行Jest时出错:“npmtesting意外死亡”

在CircleCI上运行我的Jesttesting套件与本地相比慢得多,导致CircleCI出现错误,说npm test died unexpectedly

为了让您了解CircleCI与本地testing持续时间的差异(MacBook Air 2012,fwiw):

CircleCI:

97 tests passed (97 total in 25 test suites, run time 123.918s) npm test died unexpectedly

本地:

97 tests passed (97 total in 25 test suites, run time 13.601s)

我发现与Jest和CircleCI有关的唯一半相关信息是关于控制内存使用情况的问题 ,但是我不认为我遇到的问题是相关的,但是如果我知道这个问题,在这里:)

任何想法可能会发生在这里,或debugging提示?

感谢#jest频道的@cpojer ,通过使用--runInBand运行我的testing,我能够将testing运行时间降低到--runInBand ,其中:

在当前进程中连续运行所有testing(而不是创build一个运行testing的subprocess的工作池)。 这对于debugging有时是有用的,但是这种用例很less见。