Socket
Socket
Sign inDemoInstall

jest-html-reporter

Package Overview
Dependencies
489
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.8.1 to 2.8.2

dist/htmlreporter.js

12

dist/main.js

@@ -534,14 +534,4 @@ 'use strict';

consoleLogContainer.ele('div', { class: 'suite-consolelog-header' }, 'Console Log');
// Sort the order by the path
const sortedConsoleLogs = filteredConsoleLogs.logs.sort((a, b) => {
if (a.origin < b.origin) {
return -1;
}
if (a.origin > b.origin) {
return 1;
}
return 0;
});
// Apply the logs to the body
sortedConsoleLogs.forEach((log) => {
filteredConsoleLogs.logs.forEach((log) => {
const logElement = consoleLogContainer.ele('div', { class: 'suite-consolelog-item' });

@@ -548,0 +538,0 @@ logElement.ele('pre', { class: 'suite-consolelog-item-origin' }, stripAnsi(log.origin));

@@ -1,1 +0,1 @@

"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var fs=_interopDefault(require("fs")),path=_interopDefault(require("path")),mkdirp=_interopDefault(require("mkdirp")),xmlbuilder=_interopDefault(require("xmlbuilder")),dateformat=_interopDefault(require("dateformat")),stripAnsi=_interopDefault(require("strip-ansi"));function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var utils=createCommonjsModule(function(e){e.exports={logMessage:({type:e,msg:t,ignoreConsole:s})=>{const o={default:"%s",success:"%s",error:"%s"},n=o[e]?o[e]:o.default,i=`jest-html-reporter >> ${t}`;return s||console.log(n,i),{logColor:n,logMsg:i}},writeFile:({filePath:e,content:t})=>new Promise((s,o)=>{mkdirp(path.dirname(e),n=>n?o(new Error(`Something went wrong when creating the folder: ${n}`)):fs.writeFile(e,t,t=>t?o(new Error(`Something went wrong when creating the file: ${t}`)):s(e)))}),appendFile:({filePath:e,content:t})=>new Promise((s,o)=>{mkdirp(path.dirname(e),n=>n?o(new Error(`Something went wrong when creating the folder: ${n}`)):fs.readFile(e,"utf8",(n,i)=>{let r=t;if(!n){const n=/<body>(.*?)<\/body>/gm.exec(t);if(n){const[e]=n;r=e}if(i){let t=i;const n=/<\/body>/gm.exec(i),l=n?n.index:0;return t=[i.slice(0,l),r,i.slice(l)].join(""),fs.writeFile(e,t,t=>t?o(new Error(`Something went wrong when creating the file: ${t}`)):s(e))}}return fs.appendFile(e,r,t=>t?o(new Error(`Something went wrong when appending the file: ${t}`)):s(e))}))}),getFileContent:({filePath:e})=>new Promise((t,s)=>{fs.readFile(e,"utf8",(o,n)=>o?s(new Error(`Could not locate file: '${e}': ${o}`)):t(n))}),createHtmlBase:({pageTitle:e,stylesheet:t,stylesheetPath:s})=>{const o={html:{head:{meta:{"@charset":"utf-8"},title:{"#text":e}}}};return s?o.html.head.link={"@rel":"stylesheet","@type":"text/css","@href":s}:o.html.head.style={"@type":"text/css","#text":t},xmlbuilder.create(o)},sortAlphabetically:({a:e,b:t,reversed:s})=>!s&&e<t||s&&e>t?-1:!s&&e>t||s&&e<t?1:0}}),utils_1=utils.logMessage,utils_2=utils.writeFile,utils_3=utils.appendFile,utils_4=utils.getFileContent,utils_5=utils.createHtmlBase,utils_6=utils.sortAlphabetically,sorting=createCommonjsModule(function(e){e.exports={sortSuiteResults:({testData:e,sortMethod:t})=>{if(t)switch(t.toLowerCase()){case"status":return(e=>{const t=[],s=[],o=[];return e.forEach(e=>{const n=[],i=[],r=[];e.testResults.forEach(e=>{"pending"===e.status?n.push(e):"failed"===e.status?i.push(e):r.push(e)}),n.length&&t.push(Object.assign({},e,{testResults:n})),i.length&&s.push(Object.assign({},e,{testResults:i})),r.length&&o.push(Object.assign({},e,{testResults:r}))}),[].concat(t,s,o)})(e);case"executiondesc":return(e=>(e&&e.sort((e,t)=>t.perfStats.end-t.perfStats.start-(e.perfStats.end-e.perfStats.start)),e))(e);case"executionasc":return(e=>(e&&e.sort((e,t)=>e.perfStats.end-e.perfStats.start-(t.perfStats.end-t.perfStats.start)),e))(e);case"titledesc":return(e=>{if(e){const t=e.sort((e,t)=>utils.sortAlphabetically({a:e.testFilePath,b:t.testFilePath,reversed:!0}));return t.forEach(e=>{e.testResults.sort((e,t)=>utils.sortAlphabetically({a:e.ancestorTitles.join(" "),b:t.ancestorTitles.join(" "),reversed:!0}))}),t}return e})(e);case"titleasc":return(e=>{if(e){const t=e.sort((e,t)=>utils.sortAlphabetically({a:e.testFilePath,b:t.testFilePath}));return t.forEach(e=>{e.testResults.sort((e,t)=>utils.sortAlphabetically({a:e.ancestorTitles.join(" "),b:t.ancestorTitles.join(" ")}))}),t}return e})(e);default:return e}return e}}}),sorting_1=sorting.sortSuiteResults;class ReportGenerator{constructor(e){this.config=e,this.consoleLogs=null}generate({data:e,ignoreConsole:t}){const s=this.config.getOutputFilepath(),o=this.config.shouldUseCssFile(),n=this.config.shouldGetStylesheetContent(),i=this.config.getAppend();let r=null,l=null;return o&&(r=this.config.getStylesheetFilepath()),(l=n?()=>this.getStylesheetContent():()=>Promise.resolve())().then(t=>this.renderHtmlReport({data:e,stylesheet:t,stylesheetPath:r})).then(e=>i?utils.appendFile({filePath:s,content:e}):utils.writeFile({filePath:s,content:e})).then(()=>utils.logMessage({type:"success",msg:`Report generated (${s})`,ignoreConsole:t})).catch(e=>utils.logMessage({type:"error",msg:e,ignoreConsole:t}))}integrateContentIntoBoilerplate({content:e}){const t=this.config.getBoilerplatePath();return new Promise((s,o)=>utils.getFileContent({filePath:t}).then(t=>s(t.replace("{jesthtmlreporter-content}",e))).catch(e=>o(e)))}getStylesheetContent(){const e=this.config.getStylesheetFilepath();return utils.getFileContent({filePath:e})}renderHtmlReport({data:e,stylesheet:t,stylesheetPath:s}){return new Promise((o,n)=>{if(!e)return n(new Error("Test data missing or malformed"));const i=this.config.getPageTitle(),r=this.getReportBody({data:e,pageTitle:i});if(this.config.getBoilerplatePath())return this.integrateContentIntoBoilerplate({content:r}).then(e=>o(e));const l=utils.createHtmlBase({pageTitle:i,stylesheet:t,stylesheetPath:s}),a=l.ele("body");a.raw(r);const c=this.config.getCustomScriptFilepath();return c&&a.raw(`<script src="${c}"><\/script>`),o(l)})}getReportBody({data:e,pageTitle:t}){const s=xmlbuilder.begin().element("div",{id:"jesthtml-content"}),o=s.ele("header");o.ele("h1",{id:"title"},t);const n=this.config.getLogo();n&&o.ele("img",{id:"logo",src:n});const i=s.ele("div",{id:"metadata-container"}),r=new Date(e.startTime);i.ele("div",{id:"timestamp"},`Start: ${dateformat(r,this.config.getDateFormat())}`),i.ele("div",{id:"summary"},`${e.numTotalTests} tests -- ${e.numPassedTests} passed / ${e.numFailedTests} failed / ${e.numPendingTests} pending`);const l=sorting.sortSuiteResults({testData:e.testResults,sortMethod:this.config.getSort()}),a=this.config.getStatusIgnoreFilter();let c=[];return a&&(c=a.replace(/\s/g,"").toLowerCase().split(",")),l.forEach(e=>{for(let t=e.testResults.length-1;t>=0;t-=1)c.includes(e.testResults[t].status)&&e.testResults.splice(t,1);if(!e.testResults||e.testResults.length<=0)return;const t=s.ele("div",{class:"suite-info"});t.ele("div",{class:"suite-path"},e.testFilePath);const o=(e.perfStats.end-e.perfStats.start)/1e3;t.ele("div",{class:`suite-time${o>5?" warn":""}`},`${o}s`);const n=s.ele("table",{class:"suite-table",cellspacing:"0",cellpadding:"0"});if(e.testResults.forEach(e=>{const t=n.ele("tr",{class:e.status});t.ele("td",{class:"suite"},e.ancestorTitles.join(" > "));const s=t.ele("td",{class:"test"},e.title);if(e.failureMessages&&this.config.shouldIncludeFailureMessages()){const t=s.ele("div",{class:"failureMessages"});e.failureMessages.forEach(e=>{t.ele("pre",{class:"failureMsg"},stripAnsi(e))})}t.ele("td",{class:"result"},"passed"===e.status?`${e.status} in ${e.duration/1e3}s`:e.status)}),this.consoleLogs&&this.consoleLogs.length>0&&this.config.shouldIncludeConsoleLog()){const t=this.consoleLogs.find(t=>t.testFilePath===e.testFilePath);if(t&&t.logs.length>0){const e=s.ele("div",{class:"suite-consolelog"});e.ele("div",{class:"suite-consolelog-header"},"Console Log"),t.logs.sort((e,t)=>e.origin<t.origin?-1:e.origin>t.origin?1:0).forEach(t=>{const s=e.ele("div",{class:"suite-consolelog-item"});s.ele("pre",{class:"suite-consolelog-item-origin"},stripAnsi(t.origin)),s.ele("pre",{class:"suite-consolelog-item-message"},stripAnsi(t.message))})}}}),s}}var reportGenerator=ReportGenerator,config_1=createCommonjsModule(function(e){const t={},s=e=>Object.assign(t,e),o=()=>process.env.JEST_HTML_REPORTER_THEME||t.theme||"defaultTheme",n=()=>Boolean(process.env.JEST_HTML_REPORTER_STYLE_OVERRIDE_PATH)||Boolean(t.styleOverridePath),i=()=>process.env.JEST_HTML_REPORTER_USE_CSS_FILE||t.useCssFile||!1;e.exports={config:t,setup:()=>{try{const e=fs.readFileSync(path.join(process.cwd(),"jesthtmlreporter.config.json"),"utf8");if(e)return s(JSON.parse(e))}catch(e){}try{const e=fs.readFileSync(path.join(process.cwd(),"package.json"),"utf8");if(e)return s(JSON.parse(e)["jest-html-reporter"])}catch(e){}return t},setConfigData:s,getOutputFilepath:()=>{return(process.env.JEST_HTML_REPORTER_OUTPUT_PATH||t.outputPath||path.join(process.cwd(),"test-report.html")).replace(/<rootdir>/gi,".")},getStylesheetFilepath:()=>process.env.JEST_HTML_REPORTER_STYLE_OVERRIDE_PATH||t.styleOverridePath||path.join(__dirname,`../style/${o()}.css`),getHasStyleOverridePath:n,getCustomScriptFilepath:()=>process.env.JEST_HTML_REPORTER_CUSTOM_SCRIPT_PATH||t.customScriptPath||null,getPageTitle:()=>process.env.JEST_HTML_REPORTER_PAGE_TITLE||t.pageTitle||"Test report",getLogo:()=>process.env.JEST_HTML_REPORTER_LOGO||t.logo||null,shouldIncludeFailureMessages:()=>process.env.JEST_HTML_REPORTER_INCLUDE_FAILURE_MSG||t.includeFailureMsg||!1,shouldIncludeConsoleLog:()=>process.env.JEST_HTML_REPORTER_INCLUDE_CONSOLE_LOG||t.includeConsoleLog||!1,shouldUseCssFile:i,shouldGetStylesheetContent:()=>!(n()&&i()),getExecutionTimeWarningThreshold:()=>process.env.JEST_HTML_REPORTER_EXECUTION_TIME_WARNING_THRESHOLD||t.executionTimeWarningThreshold||5,getBoilerplatePath:()=>process.env.JEST_HTML_REPORTER_BOILERPLATE||t.boilerplate||null,getTheme:o,getDateFormat:()=>process.env.JEST_HTML_REPORTER_DATE_FORMAT||t.dateFormat||"yyyy-mm-dd HH:MM:ss",getSort:()=>process.env.JEST_HTML_REPORTER_SORT||t.sort||"default",getStatusIgnoreFilter:()=>process.env.JEST_HTML_REPORTER_STATUS_FILTER||t.statusIgnoreFilter||null,getAppend:()=>process.env.JEST_HTML_REPORTER_APPEND||t.append||!1}}),config_2=config_1.config,config_3=config_1.setup,config_4=config_1.setConfigData,config_5=config_1.getOutputFilepath,config_6=config_1.getStylesheetFilepath,config_7=config_1.getHasStyleOverridePath,config_8=config_1.getCustomScriptFilepath,config_9=config_1.getPageTitle,config_10=config_1.getLogo,config_11=config_1.shouldIncludeFailureMessages,config_12=config_1.shouldIncludeConsoleLog,config_13=config_1.shouldUseCssFile,config_14=config_1.shouldGetStylesheetContent,config_15=config_1.getExecutionTimeWarningThreshold,config_16=config_1.getBoilerplatePath,config_17=config_1.getTheme,config_18=config_1.getDateFormat,config_19=config_1.getSort,config_20=config_1.getStatusIgnoreFilter,config_21=config_1.getAppend;function JestHtmlReporter(e,t){config_1.setup();const s=new reportGenerator(config_1);if(Object.prototype.hasOwnProperty.call(e,"testResults"))return s.generate({data:e}),e;this.jestConfig=e,this.jestOptions=t,this.consoleLogs=[],this.onTestResult=((e,t)=>{t.console&&this.consoleLogs.push({testFilePath:t.testFilePath,logs:t.console})}),this.onRunComplete=((e,t)=>(config_1.setConfigData(this.jestOptions),s.config=config_1,s.consoleLogs=this.consoleLogs,s.generate({data:t})))}var src=JestHtmlReporter;module.exports=src;
"use strict";function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var fs=_interopDefault(require("fs")),path=_interopDefault(require("path")),mkdirp=_interopDefault(require("mkdirp")),xmlbuilder=_interopDefault(require("xmlbuilder")),dateformat=_interopDefault(require("dateformat")),stripAnsi=_interopDefault(require("strip-ansi"));function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var utils=createCommonjsModule(function(e){e.exports={logMessage:({type:e,msg:t,ignoreConsole:s})=>{const o={default:"%s",success:"%s",error:"%s"},n=o[e]?o[e]:o.default,i=`jest-html-reporter >> ${t}`;return s||console.log(n,i),{logColor:n,logMsg:i}},writeFile:({filePath:e,content:t})=>new Promise((s,o)=>{mkdirp(path.dirname(e),n=>n?o(new Error(`Something went wrong when creating the folder: ${n}`)):fs.writeFile(e,t,t=>t?o(new Error(`Something went wrong when creating the file: ${t}`)):s(e)))}),appendFile:({filePath:e,content:t})=>new Promise((s,o)=>{mkdirp(path.dirname(e),n=>n?o(new Error(`Something went wrong when creating the folder: ${n}`)):fs.readFile(e,"utf8",(n,i)=>{let r=t;if(!n){const n=/<body>(.*?)<\/body>/gm.exec(t);if(n){const[e]=n;r=e}if(i){let t=i;const n=/<\/body>/gm.exec(i),l=n?n.index:0;return t=[i.slice(0,l),r,i.slice(l)].join(""),fs.writeFile(e,t,t=>t?o(new Error(`Something went wrong when creating the file: ${t}`)):s(e))}}return fs.appendFile(e,r,t=>t?o(new Error(`Something went wrong when appending the file: ${t}`)):s(e))}))}),getFileContent:({filePath:e})=>new Promise((t,s)=>{fs.readFile(e,"utf8",(o,n)=>o?s(new Error(`Could not locate file: '${e}': ${o}`)):t(n))}),createHtmlBase:({pageTitle:e,stylesheet:t,stylesheetPath:s})=>{const o={html:{head:{meta:{"@charset":"utf-8"},title:{"#text":e}}}};return s?o.html.head.link={"@rel":"stylesheet","@type":"text/css","@href":s}:o.html.head.style={"@type":"text/css","#text":t},xmlbuilder.create(o)},sortAlphabetically:({a:e,b:t,reversed:s})=>!s&&e<t||s&&e>t?-1:!s&&e>t||s&&e<t?1:0}}),utils_1=utils.logMessage,utils_2=utils.writeFile,utils_3=utils.appendFile,utils_4=utils.getFileContent,utils_5=utils.createHtmlBase,utils_6=utils.sortAlphabetically,sorting=createCommonjsModule(function(e){e.exports={sortSuiteResults:({testData:e,sortMethod:t})=>{if(t)switch(t.toLowerCase()){case"status":return(e=>{const t=[],s=[],o=[];return e.forEach(e=>{const n=[],i=[],r=[];e.testResults.forEach(e=>{"pending"===e.status?n.push(e):"failed"===e.status?i.push(e):r.push(e)}),n.length&&t.push(Object.assign({},e,{testResults:n})),i.length&&s.push(Object.assign({},e,{testResults:i})),r.length&&o.push(Object.assign({},e,{testResults:r}))}),[].concat(t,s,o)})(e);case"executiondesc":return(e=>(e&&e.sort((e,t)=>t.perfStats.end-t.perfStats.start-(e.perfStats.end-e.perfStats.start)),e))(e);case"executionasc":return(e=>(e&&e.sort((e,t)=>e.perfStats.end-e.perfStats.start-(t.perfStats.end-t.perfStats.start)),e))(e);case"titledesc":return(e=>{if(e){const t=e.sort((e,t)=>utils.sortAlphabetically({a:e.testFilePath,b:t.testFilePath,reversed:!0}));return t.forEach(e=>{e.testResults.sort((e,t)=>utils.sortAlphabetically({a:e.ancestorTitles.join(" "),b:t.ancestorTitles.join(" "),reversed:!0}))}),t}return e})(e);case"titleasc":return(e=>{if(e){const t=e.sort((e,t)=>utils.sortAlphabetically({a:e.testFilePath,b:t.testFilePath}));return t.forEach(e=>{e.testResults.sort((e,t)=>utils.sortAlphabetically({a:e.ancestorTitles.join(" "),b:t.ancestorTitles.join(" ")}))}),t}return e})(e);default:return e}return e}}}),sorting_1=sorting.sortSuiteResults;class ReportGenerator{constructor(e){this.config=e,this.consoleLogs=null}generate({data:e,ignoreConsole:t}){const s=this.config.getOutputFilepath(),o=this.config.shouldUseCssFile(),n=this.config.shouldGetStylesheetContent(),i=this.config.getAppend();let r=null,l=null;return o&&(r=this.config.getStylesheetFilepath()),(l=n?()=>this.getStylesheetContent():()=>Promise.resolve())().then(t=>this.renderHtmlReport({data:e,stylesheet:t,stylesheetPath:r})).then(e=>i?utils.appendFile({filePath:s,content:e}):utils.writeFile({filePath:s,content:e})).then(()=>utils.logMessage({type:"success",msg:`Report generated (${s})`,ignoreConsole:t})).catch(e=>utils.logMessage({type:"error",msg:e,ignoreConsole:t}))}integrateContentIntoBoilerplate({content:e}){const t=this.config.getBoilerplatePath();return new Promise((s,o)=>utils.getFileContent({filePath:t}).then(t=>s(t.replace("{jesthtmlreporter-content}",e))).catch(e=>o(e)))}getStylesheetContent(){const e=this.config.getStylesheetFilepath();return utils.getFileContent({filePath:e})}renderHtmlReport({data:e,stylesheet:t,stylesheetPath:s}){return new Promise((o,n)=>{if(!e)return n(new Error("Test data missing or malformed"));const i=this.config.getPageTitle(),r=this.getReportBody({data:e,pageTitle:i});if(this.config.getBoilerplatePath())return this.integrateContentIntoBoilerplate({content:r}).then(e=>o(e));const l=utils.createHtmlBase({pageTitle:i,stylesheet:t,stylesheetPath:s}),a=l.ele("body");a.raw(r);const c=this.config.getCustomScriptFilepath();return c&&a.raw(`<script src="${c}"><\/script>`),o(l)})}getReportBody({data:e,pageTitle:t}){const s=xmlbuilder.begin().element("div",{id:"jesthtml-content"}),o=s.ele("header");o.ele("h1",{id:"title"},t);const n=this.config.getLogo();n&&o.ele("img",{id:"logo",src:n});const i=s.ele("div",{id:"metadata-container"}),r=new Date(e.startTime);i.ele("div",{id:"timestamp"},`Start: ${dateformat(r,this.config.getDateFormat())}`),i.ele("div",{id:"summary"},`${e.numTotalTests} tests -- ${e.numPassedTests} passed / ${e.numFailedTests} failed / ${e.numPendingTests} pending`);const l=sorting.sortSuiteResults({testData:e.testResults,sortMethod:this.config.getSort()}),a=this.config.getStatusIgnoreFilter();let c=[];return a&&(c=a.replace(/\s/g,"").toLowerCase().split(",")),l.forEach(e=>{for(let t=e.testResults.length-1;t>=0;t-=1)c.includes(e.testResults[t].status)&&e.testResults.splice(t,1);if(!e.testResults||e.testResults.length<=0)return;const t=s.ele("div",{class:"suite-info"});t.ele("div",{class:"suite-path"},e.testFilePath);const o=(e.perfStats.end-e.perfStats.start)/1e3;t.ele("div",{class:`suite-time${o>5?" warn":""}`},`${o}s`);const n=s.ele("table",{class:"suite-table",cellspacing:"0",cellpadding:"0"});if(e.testResults.forEach(e=>{const t=n.ele("tr",{class:e.status});t.ele("td",{class:"suite"},e.ancestorTitles.join(" > "));const s=t.ele("td",{class:"test"},e.title);if(e.failureMessages&&this.config.shouldIncludeFailureMessages()){const t=s.ele("div",{class:"failureMessages"});e.failureMessages.forEach(e=>{t.ele("pre",{class:"failureMsg"},stripAnsi(e))})}t.ele("td",{class:"result"},"passed"===e.status?`${e.status} in ${e.duration/1e3}s`:e.status)}),this.consoleLogs&&this.consoleLogs.length>0&&this.config.shouldIncludeConsoleLog()){const t=this.consoleLogs.find(t=>t.testFilePath===e.testFilePath);if(t&&t.logs.length>0){const e=s.ele("div",{class:"suite-consolelog"});e.ele("div",{class:"suite-consolelog-header"},"Console Log"),t.logs.forEach(t=>{const s=e.ele("div",{class:"suite-consolelog-item"});s.ele("pre",{class:"suite-consolelog-item-origin"},stripAnsi(t.origin)),s.ele("pre",{class:"suite-consolelog-item-message"},stripAnsi(t.message))})}}}),s}}var reportGenerator=ReportGenerator,config_1=createCommonjsModule(function(e){const t={},s=e=>Object.assign(t,e),o=()=>process.env.JEST_HTML_REPORTER_THEME||t.theme||"defaultTheme",n=()=>Boolean(process.env.JEST_HTML_REPORTER_STYLE_OVERRIDE_PATH)||Boolean(t.styleOverridePath),i=()=>process.env.JEST_HTML_REPORTER_USE_CSS_FILE||t.useCssFile||!1;e.exports={config:t,setup:()=>{try{const e=fs.readFileSync(path.join(process.cwd(),"jesthtmlreporter.config.json"),"utf8");if(e)return s(JSON.parse(e))}catch(e){}try{const e=fs.readFileSync(path.join(process.cwd(),"package.json"),"utf8");if(e)return s(JSON.parse(e)["jest-html-reporter"])}catch(e){}return t},setConfigData:s,getOutputFilepath:()=>{return(process.env.JEST_HTML_REPORTER_OUTPUT_PATH||t.outputPath||path.join(process.cwd(),"test-report.html")).replace(/<rootdir>/gi,".")},getStylesheetFilepath:()=>process.env.JEST_HTML_REPORTER_STYLE_OVERRIDE_PATH||t.styleOverridePath||path.join(__dirname,`../style/${o()}.css`),getHasStyleOverridePath:n,getCustomScriptFilepath:()=>process.env.JEST_HTML_REPORTER_CUSTOM_SCRIPT_PATH||t.customScriptPath||null,getPageTitle:()=>process.env.JEST_HTML_REPORTER_PAGE_TITLE||t.pageTitle||"Test report",getLogo:()=>process.env.JEST_HTML_REPORTER_LOGO||t.logo||null,shouldIncludeFailureMessages:()=>process.env.JEST_HTML_REPORTER_INCLUDE_FAILURE_MSG||t.includeFailureMsg||!1,shouldIncludeConsoleLog:()=>process.env.JEST_HTML_REPORTER_INCLUDE_CONSOLE_LOG||t.includeConsoleLog||!1,shouldUseCssFile:i,shouldGetStylesheetContent:()=>!(n()&&i()),getExecutionTimeWarningThreshold:()=>process.env.JEST_HTML_REPORTER_EXECUTION_TIME_WARNING_THRESHOLD||t.executionTimeWarningThreshold||5,getBoilerplatePath:()=>process.env.JEST_HTML_REPORTER_BOILERPLATE||t.boilerplate||null,getTheme:o,getDateFormat:()=>process.env.JEST_HTML_REPORTER_DATE_FORMAT||t.dateFormat||"yyyy-mm-dd HH:MM:ss",getSort:()=>process.env.JEST_HTML_REPORTER_SORT||t.sort||"default",getStatusIgnoreFilter:()=>process.env.JEST_HTML_REPORTER_STATUS_FILTER||t.statusIgnoreFilter||null,getAppend:()=>process.env.JEST_HTML_REPORTER_APPEND||t.append||!1}}),config_2=config_1.config,config_3=config_1.setup,config_4=config_1.setConfigData,config_5=config_1.getOutputFilepath,config_6=config_1.getStylesheetFilepath,config_7=config_1.getHasStyleOverridePath,config_8=config_1.getCustomScriptFilepath,config_9=config_1.getPageTitle,config_10=config_1.getLogo,config_11=config_1.shouldIncludeFailureMessages,config_12=config_1.shouldIncludeConsoleLog,config_13=config_1.shouldUseCssFile,config_14=config_1.shouldGetStylesheetContent,config_15=config_1.getExecutionTimeWarningThreshold,config_16=config_1.getBoilerplatePath,config_17=config_1.getTheme,config_18=config_1.getDateFormat,config_19=config_1.getSort,config_20=config_1.getStatusIgnoreFilter,config_21=config_1.getAppend;function JestHtmlReporter(e,t){config_1.setup();const s=new reportGenerator(config_1);if(Object.prototype.hasOwnProperty.call(e,"testResults"))return s.generate({data:e}),e;this.jestConfig=e,this.jestOptions=t,this.consoleLogs=[],this.onTestResult=((e,t)=>{t.console&&this.consoleLogs.push({testFilePath:t.testFilePath,logs:t.console})}),this.onRunComplete=((e,t)=>(config_1.setConfigData(this.jestOptions),s.config=config_1,s.consoleLogs=this.consoleLogs,s.generate({data:t})))}var src=JestHtmlReporter;module.exports=src;
{
"name": "jest-html-reporter",
"version": "2.8.1",
"version": "2.8.2",
"description": "Jest test results processor for generating a summary in HTML",

@@ -47,3 +47,3 @@ "main": "dist/main",

"peerDependencies": {
"jest": "19.x - 24.x"
"jest": "19.x - 25.x"
},

@@ -53,6 +53,6 @@ "devDependencies": {

"eslint-config-airbnb-base": "^12.1.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-import": "^2.20.1",
"istanbul-api": "1.2.2",
"istanbul-reports": "1.1.4",
"jest": "^24.9.0",
"jest": "^25.1.0",
"rollup": "^0.55.5",

@@ -59,0 +59,0 @@ "rollup-plugin-commonjs": "^8.4.1",

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