All local tests are run (which is no tests in an org with no local tests).
ERROR running force:apex:test:run: Always provide a classes, suites, tests, or testLevel property.
error is returned.
{
"cliVersion": "sfdx-cli/7.123.0",
"architecture": "darwin-x64",
"nodeVersion": "node-v14.18.1",
"pluginVersions": [
"@assisisolutions/sfdx-ci-plugin 1.0.1",
"@oclif/plugin-autocomplete 0.3.0 (core)",
"@oclif/plugin-commands 1.3.0 (core)",
"@oclif/plugin-help 3.2.3 (core)",
"@oclif/plugin-not-found 1.2.4 (core)",
"@oclif/plugin-plugins 1.10.1 (core)",
"@oclif/plugin-update 1.5.0 (core)",
"@oclif/plugin-warn-if-update-available 1.7.0 (core)",
"@oclif/plugin-which 1.0.3 (core)",
"alias 1.1.22 (core)",
"auth 1.7.3 (core)",
"config 1.2.41 (core)",
"generator 1.2.0 (core)",
"salesforcedx 52.0.0",
"├─ data 0.4.11",
"├─ apex 0.2.2",
"├─ schema 1.0.7",
"├─ custom-metadata 1.0.12",
"├─ templates 51.5.0",
"├─ org 1.6.6",
"├─ limits 1.2.1",
"├─ user 1.3.0",
"├─ salesforce-alm 52.0.0",
"└─ @salesforce/sfdx-plugin-lwc-test 0.1.7",
"sfdx-cli 7.123.0 (core)",
"source 1.2.4 (core)",
"telemetry 1.2.8 (core)",
"texei-sfdx-plugin 1.11.1",
"trust 1.0.8 (core)"
],
"osVersion": "Darwin 19.6.0"
}
Summary
SFDX exits with the following error when running
sfdx force:apex:test:run -l RunLocalTestson a project with no tests:Since
-lsets thetestLevelproperty, the error message is wrong (testLevelwas provided). In the case where there are no local tests andRunLocalTestsis set as test level, the call should just complete without doing anything.Steps To Reproduce:
sfdx force:apex:test:run -l RunLocalTestsin a DX project that has no tests, with the scratch org already created and set as the default username.Expected result
All local tests are run (which is no tests in an org with no local tests).
Actual result
error is returned.
System Information
Additional information
N/A