mochawesome-report-generator
Advanced tools
Comparing version 6.1.0 to 6.1.1
@@ -21,2 +21,3 @@ "use strict"; | ||
const JsonFileRegex = /\.json{1}$/; | ||
const htmlJsonExtRegex = /\.(?:html|json)$/; | ||
@@ -188,3 +189,3 @@ const mapJsonErrors = errors => errors.map(e => ` ${e.message}`).join('\n'); | ||
const status = data.stats.failures > 0 ? STATUSES.Fail : STATUSES.Pass; | ||
outFilename = outFilename.replace(NAME_REPLACE, DEFAULT_FILENAME).replace(STATUS_REPLACE, status).replace(DATETIME_REPLACE, ts); | ||
outFilename = outFilename.replace(NAME_REPLACE, DEFAULT_FILENAME).replace(STATUS_REPLACE, status).replace(DATETIME_REPLACE, ts).replace(htmlJsonExtRegex, ''); | ||
return outFilename; | ||
@@ -191,0 +192,0 @@ } |
@@ -28,3 +28,3 @@ /* | ||
/*! mochawesome-report-generator 6.1.0 | https://github.com/adamgruber/mochawesome-report-generator */ | ||
/*! mochawesome-report-generator 6.1.1 | https://github.com/adamgruber/mochawesome-report-generator */ | ||
@@ -31,0 +31,0 @@ /** @license React v0.19.1 |
@@ -26,2 +26,3 @@ "use strict"; | ||
var fileExtRegex = /\.[^.]*?$/; | ||
var htmlJsonExtRegex = /\.(?:html|json)$/; | ||
var semverRegex = /\d+\.\d+\.\d+(?:-(alpha|beta)\.\d+)?/; | ||
@@ -134,3 +135,3 @@ /** | ||
var status = reportData.stats.failures > 0 ? STATUSES.Fail : STATUSES.Pass; | ||
filename = filename.replace(NAME_REPLACE, specFilename || DEFAULT_FILENAME).replace(STATUS_REPLACE, status).replace(DATETIME_REPLACE, ts); | ||
filename = filename.replace(NAME_REPLACE, specFilename || DEFAULT_FILENAME).replace(STATUS_REPLACE, status).replace(DATETIME_REPLACE, ts).replace(htmlJsonExtRegex, ''); | ||
return path.resolve(process.cwd(), reportDir, filename); | ||
@@ -150,9 +151,10 @@ } | ||
function getOptions(opts, reportData) { | ||
var mergedOptions = getMergedOptions(opts || {}); // For saving JSON from mochawesome reporter | ||
var mergedOptions = getMergedOptions(opts || {}); | ||
var filename = getFilename(mergedOptions, reportData); // For saving JSON from mochawesome reporter | ||
if (mergedOptions.saveJson) { | ||
mergedOptions.jsonFile = "".concat(getFilename(mergedOptions, reportData), ".json"); | ||
mergedOptions.jsonFile = "".concat(filename, ".json"); | ||
} | ||
mergedOptions.htmlFile = "".concat(getFilename(mergedOptions, reportData), ".html"); | ||
mergedOptions.htmlFile = "".concat(filename, ".html"); | ||
return mergedOptions; | ||
@@ -159,0 +161,0 @@ } |
{ | ||
"name": "mochawesome-report-generator", | ||
"version": "6.1.0", | ||
"version": "6.1.1", | ||
"description": "Generates gorgeous HTML reports from mochawesome reporter.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -78,3 +78,3 @@ mochawesome-report-generator (marge) | ||
:--- | :--- | :------ | :---------- | ||
-f, --reportFilename | string | mochawesome | Filename of saved report. *See [notes](#reportFilename) for available token replacements.* | ||
-f, --reportFilename | string | mochawesome | Filename of saved report. *See [notes](#reportfilename-replacement-tokens) for available token replacements.* | ||
-o, --reportDir | string | [cwd]/mochawesome-report | Path to save report | ||
@@ -81,0 +81,0 @@ -t, --reportTitle | string | mochawesome | Report title |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1154367
2788