关于 Salesforce Jest 测试的问题:
1) JavaScript 代码覆盖率是否需要开玩笑测试,或者只是为了将照明网络组件转移到生产环境而需要进行测试?
2) 一旦 jest 测试编写并运行,它们是否会启动相关的流程构建器(例如,LWC 有一个提交新记录的照明编辑记录表单,并且有一个流程构建器正在寻找新的记录创建然后运行Apex 可调用方法)?如果是,是否涵盖了那些 Apex 可调用方法?
谢谢!
关于 Salesforce Jest 测试的问题:
1) JavaScript 代码覆盖率是否需要开玩笑测试,或者只是为了将照明网络组件转移到生产环境而需要进行测试?
2) 一旦 jest 测试编写并运行,它们是否会启动相关的流程构建器(例如,LWC 有一个提交新记录的照明编辑记录表单,并且有一个流程构建器正在寻找新的记录创建然后运行Apex 可调用方法)?如果是,是否涵盖了那些 Apex 可调用方法?
谢谢!
Answer: For LWC, Jest are optional, not required for Production deployments either.
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.
对于 Lightning Web 组件来说,代码覆盖率不需要 Jest 测试,它们是一个不错的功能。
至于 Apex,代码覆盖率要求是 75%。
有关 Apex 代码覆盖率的更多信息,请参见: https ://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_intro.htm