@vitest/coverage-v8 1.2.1 → 1.3.0

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,8 +11,8 @@ interface TestExclude {
11
11
  excludeNodeModules?: boolean;
12
12
  relativePath?: boolean;
13
13
  }): {
14
- shouldInstrument(filePath: string): boolean;
15
- glob(cwd: string): Promise<string[]>;
14
+ shouldInstrument: (filePath: string) => boolean;
15
+ glob: (cwd: string) => Promise<string[]>;
16
16
  };
17
17
  }
18
18
  type Options = ResolvedCoverageOptions<'v8'>;
package/dist/provider.js CHANGED
@@ -208,7 +208,9 @@ class V8CoverageProvider extends BaseCoverageProvider {
208
208
  extension: this.options.extension,
209
209
  relativePath: !this.options.allowExternal
210
210
  });
211
- this.coverageFilesDirectory = resolve(this.options.reportsDirectory, ".tmp");
211
+ const shard = this.ctx.config.shard;
212
+ const tempDirectory = `.tmp${shard ? `-${shard.index}-${shard.count}` : ""}`;
213
+ this.coverageFilesDirectory = resolve(this.options.reportsDirectory, tempDirectory);
212
214
  }
213
215
  resolveOptions() {
214
216
  return this.options;
@@ -311,9 +313,9 @@ class V8CoverageProvider extends BaseCoverageProvider {
311
313
  }
312
314
  });
313
315
  }
314
- this.coverageFiles = /* @__PURE__ */ new Map();
315
- await promises.rm(this.coverageFilesDirectory, { recursive: true });
316
316
  }
317
+ this.coverageFiles = /* @__PURE__ */ new Map();
318
+ await promises.rm(this.coverageFilesDirectory, { recursive: true });
317
319
  }
318
320
  async getUntestedFiles(testedFiles) {
319
321
  const transformResults = normalizeTransformResults(this.ctx.vitenode.fetchCache);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vitest/coverage-v8",
3
3
  "type": "module",
4
- "version": "1.2.1",
4
+ "version": "1.3.0",
5
5
  "description": "V8 coverage provider for Vitest",
6
6
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
7
7
  "license": "MIT",
@@ -37,7 +37,7 @@
37
37
  "dist"
38
38
  ],
39
39
  "peerDependencies": {
40
- "vitest": "^1.0.0"
40
+ "vitest": "1.3.0"
41
41
  },
42
42
  "dependencies": {
43
43
  "@ampproject/remapping": "^2.2.1",
@@ -61,8 +61,8 @@
61
61
  "@types/istanbul-lib-source-maps": "^4.0.4",
62
62
  "@types/istanbul-reports": "^3.0.4",
63
63
  "pathe": "^1.1.1",
64
- "vite-node": "1.2.1",
65
- "vitest": "1.2.1"
64
+ "vite-node": "1.3.0",
65
+ "vitest": "1.3.0"
66
66
  },
67
67
  "scripts": {
68
68
  "build": "rimraf dist && rollup -c",