I tried using:

sfdx force:source:deploy -u [email protected] -c -p force-app/main/default -l RunSpecifiedTests -r Class1Test

But it still runs all unit tests

How could I deploy the code to the Sandbox without running any unit tests or only the unit specified above? Is there SFDX command that enable to validate / deploy code without unit tests?

1 Answer 1


Sandboxes and Developer Edition orgs require no coverage or unit tests at all, and you can further add extra flags to try and force the deploy to be accepted.


sfdx force:source:deploy -f -g -o -l NoTestRun -u username -p force-app/main/default

This overrides conflict warnings, disables warnings and errors, and skips all unit tests. If this fails for any reason, you either have a compilation error, or you're trying to deploy to production instead of a Sandbox, Developer Edition, or Scratch Org.

Make sure you check the login you're using. You can use:

sfdx force:org:open -u username

To verify which org you're connected to.

  • Thanks! That first command solved the issue
    – LucyFenel
    Oct 14, 2022 at 14:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .