【发布时间】:2019-10-23 06:07:17
【问题描述】:
我遇到了一个问题,运行 mocha 测试对 should.equal(reactComponent, undefined) 的简单检查失败并显示 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory。
【问题讨论】:
标签: node.js mocha.js should.js
我遇到了一个问题,运行 mocha 测试对 should.equal(reactComponent, undefined) 的简单检查失败并显示 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory。
【问题讨论】:
标签: node.js mocha.js should.js
我已将问题追溯到should-format 节点模块版本3.0.3 内的should-format.js 文件。
似乎actual 参数是 React 组件这一事实导致尝试格式化错误消息时失败。
一个简单的解决方法是用这种方式重写断言:(reactComponent === undefined).should.be.true();
【讨论】: