@vitest/coverage-v8 0.34.2 → 0.34.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.
@@ -10,6 +10,7 @@ interface TestExclude {
10
10
  exclude?: string | string[];
11
11
  extension?: string | string[];
12
12
  excludeNodeModules?: boolean;
13
+ relativePath?: boolean;
13
14
  }): {
14
15
  shouldInstrument(filePath: string): boolean;
15
16
  glob(cwd: string): Promise<string[]>;
package/dist/provider.js CHANGED
@@ -195,7 +195,8 @@ class V8CoverageProvider extends BaseCoverageProvider {
195
195
  include: typeof this.options.include === "undefined" ? void 0 : [...this.options.include],
196
196
  exclude: [...defaultExclude, ...defaultInclude, ...this.options.exclude],
197
197
  excludeNodeModules: true,
198
- extension: this.options.extension
198
+ extension: this.options.extension,
199
+ relativePath: !this.options.allowExternal
199
200
  });
200
201
  }
201
202
  resolveOptions() {
@@ -241,6 +242,8 @@ class V8CoverageProvider extends BaseCoverageProvider {
241
242
  sourceFinder: sourceMapStore.sourceFinder,
242
243
  watermarks: this.options.watermarks
243
244
  });
245
+ if (hasTerminalReporter(this.options.reporter))
246
+ this.ctx.logger.log(c.blue(" % ") + c.dim("Coverage report from ") + c.yellow(this.name));
244
247
  for (const reporter of this.options.reporter) {
245
248
  reports.create(reporter[0], {
246
249
  skipFull: this.options.skipFull,
@@ -353,5 +356,8 @@ function normalizeTransformResults(fetchCaches) {
353
356
  }
354
357
  return normalized;
355
358
  }
359
+ function hasTerminalReporter(reporters) {
360
+ return reporters.some(([reporter]) => reporter === "text" || reporter === "text-summary" || reporter === "text-lcov" || reporter === "teamcity");
361
+ }
356
362
 
357
363
  export { V8CoverageProvider };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/coverage-v8",
3
3
  "type": "module",
4
- "version": "0.34.2",
4
+ "version": "0.34.4",
5
5
  "description": "V8 coverage provider for Vitest",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -58,8 +58,8 @@
58
58
  "@types/istanbul-lib-source-maps": "^4.0.1",
59
59
  "@types/istanbul-reports": "^3.0.1",
60
60
  "pathe": "^1.1.1",
61
- "vitest": "0.34.2",
62
- "vite-node": "0.34.2"
61
+ "vite-node": "0.34.4",
62
+ "vitest": "0.34.4"
63
63
  },
64
64
  "scripts": {
65
65
  "build": "rimraf dist && rollup -c",