cypress-mochawesome-reporter
Advanced tools
Comparing version 3.6.1 to 3.7.0
12
cli.js
@@ -19,2 +19,4 @@ #!/usr/bin/env node | ||
.option('-o, --output <path>', 'report output folder') | ||
// TODO: change to true in the next major version? | ||
.option('-e --set-exit-code', 'set the exit code to the number of failed tests', false) | ||
.option('--debug', 'print debug logs', false); | ||
@@ -27,2 +29,3 @@ | ||
debugLog(`cli options: ${JSON.stringify(options)}`) | ||
debugLog(`cwd: ${process.cwd()}`); | ||
@@ -44,3 +47,10 @@ | ||
log('generate report'); | ||
await generateReport(); | ||
const report = await generateReport(); | ||
// replicate current cypress behavior | ||
if (options.setExitCode && report.stats.failures > 0) { | ||
debugLog(`${report.stats.failures} tests failed, set exit code`); | ||
process.exit(report.stats.failures); | ||
} | ||
})(); |
@@ -32,3 +32,3 @@ const path = require('path'); | ||
return html[0]; | ||
return { htmlPath: html[0], report }; | ||
} | ||
@@ -65,3 +65,3 @@ | ||
const [htmlPath] = await Promise.all(actions); | ||
const [{ htmlPath, report }] = await Promise.all(actions); | ||
@@ -74,4 +74,6 @@ log('HTML report successfully created!'); | ||
} | ||
return report; | ||
} | ||
module.exports = generateReport; |
{ | ||
"name": "cypress-mochawesome-reporter", | ||
"version": "3.6.1", | ||
"version": "3.7.0", | ||
"description": "Zero config Mochawesome reporter for Cypress with screenshots", | ||
@@ -5,0 +5,0 @@ "engines": { |
29913
515