1

Questions regarding Salesforce Jest testing:

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

2) 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?

Thank you!

skyboyer
  • 22,209
  • 7
  • 57
  • 64
Dima
  • 21
  • 1
  • 4

2 Answers2

0

For Lightning Web Components Jest tests are not required for code coverage, they are a nice-to-have feature.

As for Apex, code coverage requirement is 75%.

More information on Apex code coverage can be found here: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_code_coverage_intro.htm

elmondino
  • 33
  • 4
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.