diff --git a/messages/deploy.metadata.validate.md b/messages/deploy.metadata.validate.md index 506ccfa7..ca3b54ce 100644 --- a/messages/deploy.metadata.validate.md +++ b/messages/deploy.metadata.validate.md @@ -48,7 +48,7 @@ Valid values are: - RunSpecifiedTests — Runs only the tests that you specify with the --tests flag. Code coverage requirements differ from the default coverage requirements when using this test level. Executed tests must comprise a minimum of 75% code coverage for each class and trigger in the deployment package. This coverage is computed for each class and trigger individually and is different than the overall coverage percentage. -- RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked packages. This test level is the default. +- RunLocalTests — All tests in your org are run, except the ones that originate from installed managed and unlocked packages. This test level is the default, unless you specify --tests, in which case the default is RunSpecifiedTests. - RunAllTestsInOrg — All tests in your org are run, including tests of managed packages. diff --git a/src/commands/project/deploy/validate.ts b/src/commands/project/deploy/validate.ts index bc4b65c7..4636e826 100644 --- a/src/commands/project/deploy/validate.ts +++ b/src/commands/project/deploy/validate.ts @@ -102,7 +102,8 @@ export default class DeployMetadataValidate extends SfCommand TestLevel.RunSpecifiedTests, TestLevel.RunRelevantTests, ], - default: TestLevel.RunLocalTests, + default: async (context) => + Promise.resolve(context.flags.tests ? TestLevel.RunSpecifiedTests : TestLevel.RunLocalTests), description: messages.getMessage('flags.test-level.description'), summary: messages.getMessage('flags.test-level.summary'), helpGroup: testFlags,