Angular Jest单元测试遇JavaScript堆内存不足错误的解决方法
Angular项目Jest单元测试堆内存不足错误修复方案
在Angular项目中使用Jest执行单元测试时,若出现「Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory」(即JavaScript堆内存不足)错误,可使用以下已验证的命令修复:
node --max-old-space-size=8192 node_modules/jest/bin/jest --detectOpenHandles --coverage --reporters=jest-junit --coverageReporters=cobertura --coverageReporters=html
内容的提问来源于stack exchange,提问作者DaiDH
相关产品推荐
相关产品推荐

