function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Luigi MauranoLuigi Maurano 

Need Salesforce DX test classes?

Hi All,
I have a quite simple queston; using salseforce DX is still necessary run the test classes to deploy in production?
thank you all.
Raj VakatiRaj Vakati
Yes ..Still its remains same 



After the tests are run, verify that all the Apex tests have passed. Be sure that the tests cover at least 75% of the code being deployed.

 
sfdx force:mdapi:deploy --checkonly --zipfile winter19.zip --targetusername production-org \ 
--testlevel RunSpecifiedTests MyTests


Refer this link 

https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_build_mdapi_production.htm


https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_testing.htm

 
Ajay K DubediAjay K Dubedi
Hi Luigi,
As per official documents https://help.salesforce.com/articleView?id=000171224&language=en_US&type=1 , the only necessity to deploy in production is 75% code coverage of you dev org or sandbox. Further it also adds about the code coverage. With these 2 you are fine to deplo your code to production.

Hope this helps. If it does please mark it as best answer to help others too. If you require any further assistance please let me know.
Thanks and Regards,
Ajay Dubedi