apex-code-coverage-transformer 1.6.2 → 1.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  The `apex-code-coverage-transformer` is a simple Salesforce CLI plugin to transform the Apex Code Coverage JSON file into Generic Test Coverage Format (XML). This format is accepted by static code analysis tools like SonarQube.
6
6
 
7
- This plugin supports code coverage metrics created for Apex Classes, Apex Triggers, and Flows (if flows are deployed as active in your org). This also supports multiple package directories as listed in your project's `sfdx-project.json` configuration, assuming unique file-names are used in your package directories.
7
+ This plugin supports code coverage metrics created for Apex Classes and Apex Triggers. This also supports multiple package directories as listed in your project's `sfdx-project.json` configuration, assuming unique file-names are used in your package directories.
8
8
 
9
9
  To create the code coverage JSON during a Salesforce CLI deployment/validation, append `--coverage-formatters json --results-dir coverage` to the `sf project deploy` command:
10
10
 
@@ -86,12 +86,12 @@ Error (1): ENOENT: no such file or directory: {packageDirPath}
86
86
 
87
87
  ## Example
88
88
 
89
- This [code coverage JSON file](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/coverage_no_file_exts.json) created by the Salesforce CLI will be transformed into:
89
+ This [code coverage JSON file](https://raw.githubusercontent.com/mcarvin8/apex-code-coverage-transformer/main/test/coverage_no_file_exts.json) created by the Salesforce CLI will be transformed into:
90
90
 
91
91
  ```xml
92
92
  <?xml version="1.0"?>
93
93
  <coverage version="1">
94
- <file path="force-app\main\default\triggers\AccountTrigger.trigger">
94
+ <file path="packaged\triggers\AccountTrigger.trigger">
95
95
  <lineToCover lineNumber="52" covered="false"/>
96
96
  <lineToCover lineNumber="53" covered="false"/>
97
97
  <lineToCover lineNumber="59" covered="false"/>
@@ -157,38 +157,5 @@ This [code coverage JSON file](https://raw.githubusercontent.com/mcarvin8/apex-c
157
157
  <lineToCover lineNumber="9" covered="true"/>
158
158
  <lineToCover lineNumber="10" covered="true"/>
159
159
  </file>
160
- <file path="packaged\flows\Get_Info.flow-meta.xml">
161
- <lineToCover lineNumber="52" covered="false"/>
162
- <lineToCover lineNumber="53" covered="false"/>
163
- <lineToCover lineNumber="59" covered="false"/>
164
- <lineToCover lineNumber="60" covered="false"/>
165
- <lineToCover lineNumber="54" covered="true"/>
166
- <lineToCover lineNumber="55" covered="true"/>
167
- <lineToCover lineNumber="56" covered="true"/>
168
- <lineToCover lineNumber="57" covered="true"/>
169
- <lineToCover lineNumber="58" covered="true"/>
170
- <lineToCover lineNumber="61" covered="true"/>
171
- <lineToCover lineNumber="62" covered="true"/>
172
- <lineToCover lineNumber="63" covered="true"/>
173
- <lineToCover lineNumber="64" covered="true"/>
174
- <lineToCover lineNumber="65" covered="true"/>
175
- <lineToCover lineNumber="66" covered="true"/>
176
- <lineToCover lineNumber="67" covered="true"/>
177
- <lineToCover lineNumber="68" covered="true"/>
178
- <lineToCover lineNumber="69" covered="true"/>
179
- <lineToCover lineNumber="70" covered="true"/>
180
- <lineToCover lineNumber="71" covered="true"/>
181
- <lineToCover lineNumber="72" covered="true"/>
182
- <lineToCover lineNumber="73" covered="true"/>
183
- <lineToCover lineNumber="74" covered="true"/>
184
- <lineToCover lineNumber="75" covered="true"/>
185
- <lineToCover lineNumber="76" covered="true"/>
186
- <lineToCover lineNumber="77" covered="true"/>
187
- <lineToCover lineNumber="78" covered="true"/>
188
- <lineToCover lineNumber="79" covered="true"/>
189
- <lineToCover lineNumber="80" covered="true"/>
190
- <lineToCover lineNumber="81" covered="true"/>
191
- <lineToCover lineNumber="82" covered="true"/>
192
- </file>
193
160
  </coverage>
194
161
  ```
@@ -40,7 +40,7 @@ async function findFilePathinDirectory(fileName, dxDirectory) {
40
40
  }
41
41
  else {
42
42
  // If file extension is not defined, test each extension option
43
- const fileExts = ['cls', 'trigger', 'flow-meta.xml'];
43
+ const fileExts = ['cls', 'trigger'];
44
44
  for (const ext of fileExts) {
45
45
  relativeFilePath = await searchRecursively(`${fileName}.${ext}`, dxDirectory);
46
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,QAAQ,EAAE,WAAW,CAAC,CAAC;IACpE,CAAC;SAAM,CAAC;QACN,+DAA+D;QAC/D,MAAM,QAAQ,GAAa,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QAC9C,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,gBAAgB,GAAG,MAAM,iBAAiB,CAAC,GAAG,QAAQ,IAAI,GAAG,EAAE,EAAE,WAAW,CAAC,CAAC;YAC9E,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;gBACnC,MAAM;YACR,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
@@ -73,5 +73,5 @@
73
73
  ]
74
74
  }
75
75
  },
76
- "version": "1.6.2"
76
+ "version": "1.6.3"
77
77
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "apex-code-coverage-transformer",
3
3
  "description": "Transforms the Apex Code Coverage JSON into the Generic Test Data Report.",
4
- "version": "1.6.2",
4
+ "version": "1.6.3",
5
5
  "dependencies": {
6
6
  "@oclif/core": "^3.18.1",
7
7
  "@salesforce/core": "^6.4.7",