Skip to content

Commit db625d9

Browse files
authored
Merge pull request #70 from salesforcecli/phale/W-12679981
fix: default result format human + coverage depends on result format
2 parents bfb739f + 883197a commit db625d9

File tree

5 files changed

+2
-51
lines changed

5 files changed

+2
-51
lines changed

messages/runtest.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ Runs test methods from a single Apex class synchronously; if not specified, test
9191

9292
Display detailed code coverage per test.
9393

94-
# missingReporterErr
95-
96-
Select a result format when specifying code coverage
97-
9894
# runTestReportCommand
9995

10096
Run "%s apex get test -i %s -o %s" to retrieve test results

src/commands/apex/get/test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export default class Test extends SfCommand<RunResult> {
5757
char: 'r',
5858
summary: messages.getMessage('flags.result-format.summary'),
5959
options: resultFormat,
60+
default: 'human',
6061
}),
6162
};
6263

src/commands/apex/run/test.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export default class Test extends SfCommand<RunCommandResult> {
6868
char: 'r',
6969
summary: messages.getMessage('flags.result-format.summary'),
7070
options: resultFormat,
71+
default: 'human',
7172
}),
7273
'suite-names': Flags.string({
7374
deprecateAliases: true,
@@ -174,10 +175,6 @@ export default class Test extends SfCommand<RunCommandResult> {
174175
synchronous?: boolean,
175176
testLevel?: TestLevel
176177
): Promise<TestLevel> {
177-
if (codeCoverage && !resultFormatFlag) {
178-
return Promise.reject(new Error(messages.getMessage('missingReporterErr')));
179-
}
180-
181178
if ((classNames && (suiteNames || tests)) || (suiteNames && tests)) {
182179
return Promise.reject(new Error(messages.getMessage('classSuiteTestErr')));
183180
}

test/commands/apex/run/test.test.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -368,15 +368,6 @@ describe('apex:test:run', () => {
368368
});
369369

370370
describe('validateFlags', () => {
371-
// TODO: move this method to oclif flag validation
372-
it('rejects codecoverage without resultformat', async () => {
373-
try {
374-
await new Test(['--code-coverage'], config).run();
375-
} catch (e) {
376-
expect((e as Error).message).to.equal(messages.getMessage('missingReporterErr'));
377-
}
378-
});
379-
380371
it('rejects tests/classnames/suitenames and testlevels', async () => {
381372
try {
382373
await new Test(['--tests', 'mytest', '--test-level', 'RunAllTestsInOrg'], config).run();

yarn.lock

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,14 +1369,6 @@
13691369
"@typescript-eslint/types" "5.54.1"
13701370
"@typescript-eslint/visitor-keys" "5.54.1"
13711371

1372-
"@typescript-eslint/scope-manager@5.54.1":
1373-
version "5.54.1"
1374-
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.54.1.tgz#6d864b4915741c608a58ce9912edf5a02bb58735"
1375-
integrity sha512-zWKuGliXxvuxyM71UA/EcPxaviw39dB2504LqAmFDjmkpO8qNLHcmzlh6pbHs1h/7YQ9bnsO8CCcYCSA8sykUg==
1376-
dependencies:
1377-
"@typescript-eslint/types" "5.54.1"
1378-
"@typescript-eslint/visitor-keys" "5.54.1"
1379-
13801372
"@typescript-eslint/type-utils@5.53.0":
13811373
version "5.53.0"
13821374
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.53.0.tgz#41665449935ba9b4e6a1ba6e2a3f4b2c31d6cf97"
@@ -1397,11 +1389,6 @@
13971389
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.54.1.tgz#29fbac29a716d0f08c62fe5de70c9b6735de215c"
13981390
integrity sha512-G9+1vVazrfAfbtmCapJX8jRo2E4MDXxgm/IMOF4oGh3kq7XuK3JRkOg6y2Qu1VsTRmWETyTkWt1wxy7X7/yLkw==
13991391

1400-
"@typescript-eslint/types@5.54.1":
1401-
version "5.54.1"
1402-
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.54.1.tgz#29fbac29a716d0f08c62fe5de70c9b6735de215c"
1403-
integrity sha512-G9+1vVazrfAfbtmCapJX8jRo2E4MDXxgm/IMOF4oGh3kq7XuK3JRkOg6y2Qu1VsTRmWETyTkWt1wxy7X7/yLkw==
1404-
14051392
"@typescript-eslint/typescript-estree@5.53.0":
14061393
version "5.53.0"
14071394
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.53.0.tgz#bc651dc28cf18ab248ecd18a4c886c744aebd690"
@@ -1428,19 +1415,6 @@
14281415
semver "^7.3.7"
14291416
tsutils "^3.21.0"
14301417

1431-
"@typescript-eslint/typescript-estree@5.54.1":
1432-
version "5.54.1"
1433-
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.54.1.tgz#df7b6ae05fd8fef724a87afa7e2f57fa4a599be1"
1434-
integrity sha512-bjK5t+S6ffHnVwA0qRPTZrxKSaFYocwFIkZx5k7pvWfsB1I57pO/0M0Skatzzw1sCkjJ83AfGTL0oFIFiDX3bg==
1435-
dependencies:
1436-
"@typescript-eslint/types" "5.54.1"
1437-
"@typescript-eslint/visitor-keys" "5.54.1"
1438-
debug "^4.3.4"
1439-
globby "^11.1.0"
1440-
is-glob "^4.0.3"
1441-
semver "^7.3.7"
1442-
tsutils "^3.21.0"
1443-
14441418
"@typescript-eslint/utils@5.53.0":
14451419
version "5.53.0"
14461420
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.53.0.tgz#e55eaad9d6fffa120575ffaa530c7e802f13bce8"
@@ -1485,14 +1459,6 @@
14851459
"@typescript-eslint/types" "5.54.1"
14861460
eslint-visitor-keys "^3.3.0"
14871461

1488-
"@typescript-eslint/visitor-keys@5.54.1":
1489-
version "5.54.1"
1490-
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.54.1.tgz#d7a8a0f7181d6ac748f4d47b2306e0513b98bf8b"
1491-
integrity sha512-q8iSoHTgwCfgcRJ2l2x+xCbu8nBlRAlsQ33k24Adj8eoVBE0f8dUeI+bAa8F84Mv05UGbAx57g2zrRsYIooqQg==
1492-
dependencies:
1493-
"@typescript-eslint/types" "5.54.1"
1494-
eslint-visitor-keys "^3.3.0"
1495-
14961462
"@ungap/promise-all-settled@1.1.2":
14971463
version "1.1.2"
14981464
resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44"

0 commit comments

Comments
 (0)