New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

coverage-istanbul

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

coverage-istanbul - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

36

lib/index.js

@@ -61,10 +61,27 @@ "use strict";

reporter.dir = (opts === null || opts === void 0 ? void 0 : opts.dir) || './coverage';
reporter.add('lcovonly');
reporter.addAll(['clover', 'cobertura', 'html']);
reporter.addAll(['lcovonly', 'clover', 'cobertura', 'text-summary']);
reporter.write(collector, sync, function () {
// console.log('done');
resolve({
data: coverageInfo,
reporterDir: reporter.dir,
});
// 注意 ts 下设置 "esModuleInterop": true 之后使用 html 则会报错的,
// 因此在这里保护一下,但还是没解决本质问题,待后续解决
const reporterForHtml = new istanbul_1.default.Reporter();
reporterForHtml.dir = reporter.dir;
reporterForHtml.add('html');
try {
reporterForHtml.write(collector, sync, function () {
resolve({
data: coverageInfo,
reporterDir: reporter.dir,
});
});
}
catch (err) {
if (process.env.DEBUG_COVERAGE) {
console.log('--reporterForHtml err--', err);
}
console.log('Try to write html for coverage reporter failed!', ((err === null || err === void 0 ? void 0 : err.message) || err));
resolve({
data: coverageInfo,
reporterDir: reporter.dir,
});
}
});

@@ -75,5 +92,4 @@ })

});
// console.log(transformed)
if (process.env.DEBUG) {
console.log('--', typeof transformed);
if (process.env.DEBUG_COVERAGE) {
console.log('--typeof transformed--', typeof transformed);
}

@@ -80,0 +96,0 @@ });

{
"name": "coverage-istanbul",
"version": "1.1.0",
"version": "1.1.1",
"description": "istanbul tools for test coverage",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -32,3 +32,3 @@ import fs from 'fs';

opts: ICreateE2ECoverageOpts
):Promise<IE2ECoverageResult> {
): Promise<IE2ECoverageResult> {
return new Promise((resolve, reject) => {

@@ -39,3 +39,3 @@ const collector = new istanbul.Collector();

// options is optional
glob(globPattern, {}, function(err, files) {
glob(globPattern, {}, function (err, files) {
// console.log(files);

@@ -80,10 +80,28 @@ if (err) {

reporter.dir = opts?.dir || './coverage';
reporter.add('lcovonly');
reporter.addAll(['clover', 'cobertura', 'html']);
reporter.write(collector, sync, function() {
// console.log('done');
resolve({
data: coverageInfo,
reporterDir: reporter.dir,
});
reporter.addAll(['lcovonly', 'clover', 'cobertura', 'text-summary']);
reporter.write(collector, sync, function () {
// 注意 ts 下设置 "esModuleInterop": true 之后使用 html 则会报错的,
// 因此在这里保护一下,但还是没解决本质问题,待后续解决
const reporterForHtml = new istanbul.Reporter();
reporterForHtml.dir = reporter.dir;
reporterForHtml.add('html');
try {
reporterForHtml.write(collector, sync, function () {
resolve({
data: coverageInfo,
reporterDir: reporter.dir,
});
});
} catch (err) {
if (process.env.DEBUG_COVERAGE) {
console.log('--reporterForHtml err--', err);
}
console.log('Try to write html for coverage reporter failed!', (err?.message || err));
resolve({
data: coverageInfo,
reporterDir: reporter.dir,
});
}
});

@@ -95,5 +113,4 @@ })

// console.log(transformed)
if (process.env.DEBUG) {
console.log('--', typeof transformed);
if (process.env.DEBUG_COVERAGE) {
console.log('--typeof transformed--', typeof transformed);
}

@@ -100,0 +117,0 @@ });

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc