monocart-coverage-reports 2.7.2 → 2.7.4

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/lib/index.js CHANGED
@@ -28,12 +28,15 @@ const resolveConfigOptions = async (configPath) => {
28
28
  err = ee;
29
29
  }
30
30
 
31
- if (err || !configOptions) {
31
+ if (err) {
32
32
  Util.logError(`ERROR: failed to load config "${configPath}": ${err && err.message} `);
33
33
  return;
34
34
  }
35
35
 
36
- configOptions = configOptions.default || configOptions;
36
+ // could be multiple level default
37
+ while (configOptions && configOptions.default) {
38
+ configOptions = configOptions.default;
39
+ }
37
40
 
38
41
  return configOptions;
39
42
  };
@@ -237,9 +240,9 @@ class CoverageReport {
237
240
  'mcr.config.cjs',
238
241
  'mcr.config.mjs',
239
242
  'mcr.config.json',
243
+ 'mcr.config.ts',
240
244
  '.mcrrc.js',
241
- '.mcrrc',
242
- 'mcr.config.ts'
245
+ '.mcrrc'
243
246
  ];
244
247
 
245
248
  const existsList = configList.filter((p) => p && fs.existsSync(p));
@@ -262,7 +265,8 @@ class CoverageReport {
262
265
  return;
263
266
  }
264
267
 
265
- Util.logInfo(`Loaded config: ${EC.cyan(configPath)}`);
268
+ Util.logInfo(`Loaded: ${EC.cyan(configPath)}`);
269
+
266
270
  // init options again
267
271
  this.options = {
268
272
  ... defaultOptions,