Socket
Socket
Sign inDemoInstall

@vitest/coverage-istanbul

Package Overview
Dependencies
544
Maintainers
4
Versions
92
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.0 to 1.3.1

42

dist/provider.js

@@ -171,2 +171,3 @@ import { promises, existsSync, writeFileSync } from 'node:fs';

sourceMap.sources = sourceMap.sources.map(removeQueryParameters);
sourceCode = sourceCode.replaceAll("_ts_decorate", "/* istanbul ignore next */_ts_decorate");
const code = this.instrumenter.instrumentSync(sourceCode, id, sourceMap);

@@ -214,3 +215,3 @@ const map = this.instrumenter.lastSourceMap();

const coverageMapByTransformMode = libCoverage.createCoverageMap({});
for (const chunk of toSlices(filenames, this.options.processingConcurrency)) {
for (const chunk of this.toSlices(filenames, this.options.processingConcurrency)) {
if (debug.enabled) {

@@ -240,3 +241,3 @@ index += chunk.length;

});
if (hasTerminalReporter(this.options.reporter))
if (this.hasTerminalReporter(this.options.reporter))
this.ctx.logger.log(c.blue(" % ") + c.dim("Coverage report from ") + c.yellow(this.name));

@@ -268,6 +269,4 @@ for (const reporter of this.options.reporter) {

perFile: this.options.thresholds.perFile,
configurationFile: {
write: () => writeFileSync(configFilePath, configModule.generate().code, "utf-8"),
read: () => resolveConfig(configModule)
}
configurationFile: configModule,
onUpdate: () => writeFileSync(configFilePath, configModule.generate().code, "utf-8")
});

@@ -323,34 +322,3 @@ }

}
function hasTerminalReporter(reporters) {
return reporters.some(([reporter]) => reporter === "text" || reporter === "text-summary" || reporter === "text-lcov" || reporter === "teamcity");
}
function toSlices(array, size) {
return array.reduce((chunks, item) => {
const index = Math.max(0, chunks.length - 1);
const lastChunk = chunks[index] || [];
chunks[index] = lastChunk;
if (lastChunk.length >= size)
chunks.push([item]);
else
lastChunk.push(item);
return chunks;
}, []);
}
function resolveConfig(configModule) {
const mod = configModule.exports.default;
try {
if (mod.$type === "object")
return mod;
if (mod.$type === "function-call") {
if (mod.$args[0].$type === "object")
return mod.$args[0];
if (mod.$args[0].$type === "arrow-function-expression" && mod.$args[0].$body.$type === "object")
return mod.$args[0].$body;
}
} catch (error) {
throw new Error(error instanceof Error ? error.message : String(error));
}
throw new Error("Failed to update coverage thresholds. Configuration file is too complex.");
}
export { IstanbulCoverageProvider };

6

package.json
{
"name": "@vitest/coverage-istanbul",
"type": "module",
"version": "1.3.0",
"version": "1.3.1",
"description": "Istanbul coverage provider for Vitest",

@@ -40,3 +40,3 @@ "author": "Anthony Fu <anthonyfu117@hotmail.com>",

"peerDependencies": {
"vitest": "1.3.0"
"vitest": "1.3.1"
},

@@ -62,3 +62,3 @@ "dependencies": {

"pathe": "^1.1.1",
"vitest": "1.3.0"
"vitest": "1.3.1"
},

@@ -65,0 +65,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc