【问题标题】:ShouldJS `should.equal` throws JavaScript heap out of memoryShouldJS `should.equal` 抛出 JavaScript 堆内存不足
【发布时间】: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


    【解决方案1】:

    我已将问题追溯到should-format 节点模块版本3.0.3 内的should-format.js 文件。
    似乎actual 参数是 React 组件这一事实导致尝试格式化错误消息时失败。

    一个简单的解决方法是用这种方式重写断言:(reactComponent === undefined).should.be.true();

    【讨论】:

      猜你喜欢
      • 2018-02-10
      • 2019-09-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-27
      • 2017-10-10
      • 2019-09-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多