1

关于 Salesforce Jest 测试的问题:

1) JavaScript 代码覆盖率是否需要开玩笑测试,或者只是为了将照明网络组件转移到生产环境而需要进行测试?

2) 一旦 jest 测试编写并运行,它们是否会启动相关的流程构建器(例如,LWC 有一个提交新记录的照明编辑记录表单,并且有一个流程构建器正在寻找新的记录创建然后运行Apex 可调用方法)?如果是,是否涵盖了那些 Apex 可调用方法?

谢谢!

4

2 回答 2

0
  1. Are jest test required for JavaScript code coverage or just nice-to-have in order to move lighting web components to production?

Answer: For LWC, Jest are optional, not required for Production deployments either.

  1. Once jest test are written and running, do they kick off dependent process builders (e.g. a LWC has a lighting-edit-record-form that submits a new record and there is a process builder looking for a new record creation and then runs Apex invocable methods)? If yes, are those Apex invocable methods covered?

Answer: The Jest tests might "click a button" which would invoke the apex code and if there's a DML involved, the related Process Builders will also execute. However they will not cover any of the Apex code & this also means one should not execute the Jests for Prod environments.

于 2021-01-03T12:17:58.513 回答
0

对于 Lightning Web 组件来说,代码覆盖率不需要 Jest 测试,它们是一个不错的功能。

至于 Apex,代码覆盖率要求是 75%。

有关 Apex 代码覆盖率的更多信息,请参见: https ://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_intro.htm

于 2020-10-27T16:40:42.583 回答