@vitest/coverage-istanbul 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.
@@ -11,6 +11,7 @@ interface TestExclude {
11
11
  exclude?: string | string[];
12
12
  extension?: string | string[];
13
13
  excludeNodeModules?: boolean;
14
+ relativePath?: boolean;
14
15
  }): {
15
16
  shouldInstrument(filePath: string): boolean;
16
17
  glob(cwd: string): Promise<string[]>;
package/dist/provider.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { existsSync, promises } from 'fs';
2
2
  import { coverageConfigDefaults, defaultExclude, defaultInclude } from 'vitest/config';
3
3
  import { BaseCoverageProvider } from 'vitest/coverage';
4
+ import c from 'picocolors';
4
5
  import libReport from 'istanbul-lib-report';
5
6
  import reports from 'istanbul-reports';
6
7
  import libCoverage from 'istanbul-lib-coverage';
@@ -144,7 +145,8 @@ class IstanbulCoverageProvider extends BaseCoverageProvider {
144
145
  include: typeof this.options.include === "undefined" ? void 0 : [...this.options.include],
145
146
  exclude: [...defaultExclude, ...defaultInclude, ...this.options.exclude],
146
147
  excludeNodeModules: true,
147
- extension: this.options.extension
148
+ extension: this.options.extension,
149
+ relativePath: !this.options.allowExternal
148
150
  });
149
151
  }
150
152
  resolveOptions() {
@@ -184,6 +186,8 @@ class IstanbulCoverageProvider extends BaseCoverageProvider {
184
186
  sourceFinder: sourceMapStore.sourceFinder,
185
187
  watermarks: this.options.watermarks
186
188
  });
189
+ if (hasTerminalReporter(this.options.reporter))
190
+ this.ctx.logger.log(c.blue(" % ") + c.dim("Coverage report from ") + c.yellow(this.name));
187
191
  for (const reporter of this.options.reporter) {
188
192
  reports.create(reporter[0], {
189
193
  skipFull: this.options.skipFull,
@@ -263,5 +267,8 @@ function includeImplicitElseBranches(coverageMap) {
263
267
  function isEmptyCoverageRange(range) {
264
268
  return range.start === void 0 || range.start.line === void 0 || range.start.column === void 0 || range.end === void 0 || range.end.line === void 0 || range.end.column === void 0;
265
269
  }
270
+ function hasTerminalReporter(reporters) {
271
+ return reporters.some(([reporter]) => reporter === "text" || reporter === "text-summary" || reporter === "text-lcov" || reporter === "teamcity");
272
+ }
266
273
 
267
274
  export { IstanbulCoverageProvider };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/coverage-istanbul",
3
3
  "type": "module",
4
- "version": "0.34.2",
4
+ "version": "0.34.4",
5
5
  "description": "Istanbul coverage provider for Vitest",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -45,6 +45,7 @@
45
45
  "istanbul-lib-report": "^3.0.1",
46
46
  "istanbul-lib-source-maps": "^4.0.1",
47
47
  "istanbul-reports": "^3.1.5",
48
+ "picocolors": "^1.0.0",
48
49
  "test-exclude": "^6.0.0"
49
50
  },
50
51
  "devDependencies": {
@@ -54,7 +55,7 @@
54
55
  "@types/istanbul-lib-source-maps": "^4.0.1",
55
56
  "@types/istanbul-reports": "^3.0.1",
56
57
  "pathe": "^1.1.1",
57
- "vitest": "0.34.2"
58
+ "vitest": "0.34.4"
58
59
  },
59
60
  "scripts": {
60
61
  "build": "rimraf dist && rollup -c",