Skip to content

Commit 1e66e83

Browse files
authored
feat(apex get test): support detailed-coverage (#597)
* feat: add deatailed coverage for apex run test * feat: flag detailed coverage * fix: remove yarn from plugin deps * fix: update the description for code-coverage
1 parent 514d49d commit 1e66e83

File tree

4 files changed

+1049
-1192
lines changed

4 files changed

+1049
-1192
lines changed

command-snapshot.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
"flags": [
2525
"api-version",
2626
"code-coverage",
27+
"concise",
28+
"detailed-coverage",
2729
"flags-dir",
2830
"json",
2931
"loglevel",
3032
"output-dir",
3133
"result-format",
3234
"target-org",
33-
"test-run-id",
34-
"concise"
35+
"test-run-id"
3536
],
3637
"plugin": "@salesforce/plugin-apex"
3738
},
@@ -72,6 +73,7 @@
7273
"api-version",
7374
"class-names",
7475
"code-coverage",
76+
"concise",
7577
"detailed-coverage",
7678
"flags-dir",
7779
"json",
@@ -83,8 +85,7 @@
8385
"target-org",
8486
"test-level",
8587
"tests",
86-
"wait",
87-
"concise"
88+
"wait"
8889
],
8990
"plugin": "@salesforce/plugin-apex"
9091
},

messages/gettest.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Display test results for a specific asynchronous test run.
66

77
Provide a test run ID to display test results for an enqueued or completed asynchronous test run. The test run ID is displayed after running the "<%= config.bin %> apex test run" command.
88

9+
To see code coverage results, use the --code-coverage flag with --result-format. The output displays a high-level summary of the test run and the code coverage values for classes in your org. If you specify human-readable result format, use the --detailed-coverage flag to see detailed coverage results for each test method run.
10+
911
# examples
1012

1113
- Display test results for your default org using a test run ID:
@@ -39,3 +41,7 @@ Display only failed test results; works with human-readable output only.
3941
# apexLibErr
4042

4143
Unknown error in Apex Library: %s
44+
45+
# flags.detailed-coverage.summary
46+
47+
Display detailed code coverage per test.

src/commands/apex/get/test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export default class Test extends SfCommand<RunResult> {
4141
length: 'both',
4242
}),
4343
'code-coverage': codeCoverageFlag,
44+
'detailed-coverage': Flags.boolean({
45+
summary: messages.getMessage('flags.detailed-coverage.summary'),
46+
dependsOn: ['code-coverage'],
47+
}),
4448
'output-dir': Flags.directory({
4549
aliases: ['outputdir', 'output-directory'],
4650
deprecateAliases: true,
@@ -68,6 +72,7 @@ export default class Test extends SfCommand<RunResult> {
6872
'result-format': flags['result-format'],
6973
json: flags.json,
7074
'code-coverage': flags['code-coverage'],
75+
'detailed-coverage': flags['detailed-coverage'],
7176
concise: flags.concise,
7277
});
7378
}

0 commit comments

Comments
 (0)