monocart-reporter 2.7.0 → 2.7.1

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.
@@ -197,7 +197,9 @@ const generateReport = async (reportData, options) => {
197
197
  const g = report.global ? `${EC.magenta('(global)')}` : '';
198
198
  Util.logInfo(`${report.type}: ${EC.cyan(report.path)} ${report.name} ${g}`);
199
199
  // convert path to relative reporter
200
- report.path = Util.relativePath(report.path, outputDir);
200
+ if (report.path) {
201
+ report.path = Util.relativePath(report.path, outputDir);
202
+ }
201
203
  });
202
204
 
203
205
  reportData.summary.artifacts = {
package/lib/merge-data.js CHANGED
@@ -112,20 +112,18 @@ const mergeArtifacts = async (artifactsList, options) => {
112
112
  let hasAssets = false;
113
113
  item.artifacts.forEach((art) => {
114
114
 
115
- const targetDirName = path.dirname(art.path);
116
- // console.log(targetDir);
117
-
118
115
  // merge global coverage
119
116
  if (art.global && art.type === 'coverage') {
120
117
 
121
- const rawDir = path.resolve(jsonDir, targetDirName, 'raw');
118
+ const rawDir = path.resolve(jsonDir, art.rawDir);
122
119
  if (fs.existsSync(rawDir)) {
123
120
  coverageRawList.push(rawDir);
124
- return;
125
121
  }
122
+ return;
126
123
 
127
124
  }
128
125
 
126
+ const targetDirName = path.dirname(art.path);
129
127
  // copy all files in art dir, like network, audit
130
128
  copyTarget(targetDirName, jsonDir, outputDir);
131
129
  hasAssets = true;