jestjs - Salesforce LWC Jest 测试对 Apex 代码覆盖率的影响
问题描述
关于 Salesforce Jest 测试的问题:
1) JavaScript 代码覆盖率是否需要开玩笑测试,或者只是为了将照明网络组件转移到生产环境而需要进行测试?
2) 一旦 jest 测试编写并运行,它们是否会启动相关的流程构建器(例如,LWC 有一个提交新记录的照明编辑记录表单,并且有一个流程构建器正在寻找新的记录创建然后运行Apex 可调用方法)?如果是,是否涵盖了那些 Apex 可调用方法?
谢谢!
解决方案
- 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.
- 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.
推荐阅读
- javascript - 如何从选择菜单更改为按钮
- python - Windows 上的多处理:如何让子进程不必重新加载父进程加载的模块?
- sqlite - 转换数据对象 - F#、Fabulous、sql-net-pcl 和 Web API 客户端库
- javascript - toLocaleString() 在使用 toFixed 方法后改变行为?
- css - 使用css flexbox时如何防止按钮占据全宽?
- swift - 在回调 Swift 中返回回调
- excel - Excel VBA 更新/替换 Vlookup 文件名
- ios - 为什么 UITableVIew 滚动后显示数据不正确
- java - 如何修复 Java args 无法从 Windows 资源管理器的字符串中正确获取日文字符?
- javascript - 如何更改搜索功能以接受任何单词组合