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

jest-html-cumulative-reporter

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-html-cumulative-reporter - npm Package Compare versions

Comparing version

to
1.5.1

5

package.json

@@ -5,3 +5,3 @@ {

"title": "Jest HTML Cumulative Reporter",
"version": "1.5.0",
"version": "1.5.1",
"private": false,

@@ -52,4 +52,3 @@ "main": "dist/index.js",

"ansi-to-html": "^0.6.14",
"dateformat": "^3.0.3",
"escape-html": "^1.0.3"
"dateformat": "^3.0.3"
},

@@ -56,0 +55,0 @@ "scripts": {

13

src/utils/updateReportResults.js
const Convert = require('ansi-to-html');
const escapeHtml = require('escape-html');
const convert = new Convert();
const replaceTag = (tag) => {
const tagsToReplace = {
'&': '&',
'<': '&lt;',
'>': '&gt;',
};
return tagsToReplace[tag] || tag;
};
const updateReportResults = ({ options, report, results }) => {

@@ -25,4 +33,5 @@ const { ignore = [] } = options;

// Format error messages.
mergedTest.failureMessages = mergedTest.failureMessages.map((msg) => escapeHtml(convert.toHtml(msg.replace(/[\r]+/g, ''))));
mergedTest.failureMessages = mergedTest.failureMessages.map((msg) => convert.toHtml(msg.replace(/[\r]+/g, '')).replace(/[&<>]/g, replaceTag));
return mergedTest;

@@ -29,0 +38,0 @@ };