1

I have a simple LWC component that is only made up of html, javascript, and css (no APEX). When deploying to production via vscode, I am confused on what I am suppose to be testing as I receive the "INVALID_OPERATION: testLevel of NoTestRun cannot be used in production organizations" message. Am I missing something?

0

I chose an unrelated apex test class and it deployed successfully to production.

0

Specifying -l | --testlevel TESTLEVEL did it for me:

sfdx force:auth:web:login -d -a <mydevhuborg>

sfdx force:source:deploy -p force-app -u <username> -l RunLocalTests 

See the docs:

RunLocalTests—All tests in your org are run, except the ones that originate from installed managed packages.

  • Also if you have an org with way too many unit tests you don't want to run, you can pick "run specified tests" mode, and you only need to specify one single test class that passes (doesn't matter which b/c no Apex to cover) – Charles T Jan 10 at 16:00
  • @CharlesT thanks for the hint. That will come handy in some cases. – wp78de Jan 10 at 16:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.