【问题标题】:Does Angular's DestroyAfterEach option affect the speed of Jest tests?Angular 的 DestroyAfterEach 选项会影响 Jest 测试的速度吗?
【发布时间】:2021-09-15 12:51:36
【问题描述】:

DestroyAfterEach 是 Angular 12.1 中添加的一个新选项,有望大大提高测试性能 (details here)。但是,在进行此更改时,我没有注意到任何速度差异。我怀疑这可能是因为我使用的是 Jest,它不涉及浏览器。

是否预计 Jest 在应用此选项时没有任何速度改进?也有可能我错误地应用了该选项。

【问题讨论】:

    标签: angular unit-testing jestjs angular12


    【解决方案1】:

    它确实改变了速度。刚刚检查了我们的项目(Angular 13.3.2,Karma 6.3.9,Jasmine-core 3.10.1)。要编译和完成测试,从运行 npm run test 命令的那一刻起需要 45 秒 destroyAfterEach: true 和 67 秒 destroyAfterEach: false

    SUMMARY: √ 1154 tests completed i 3 tests skipped TOTAL: 1154 SUCCESS

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-07
      • 2013-11-22
      • 2019-09-18
      相关资源
      最近更新 更多