@nodebug/emailer
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -5,6 +5,6 @@ const config = require('@nodebug/config')('emailer') | ||
let directory | ||
let report | ||
let jsonFile | ||
if (config.f !== undefined) { | ||
report = resolve(config.f.replace('json:', '')) | ||
directory = dirname(report) | ||
jsonFile = resolve(config.f.replace('json:', '')) | ||
directory = dirname(jsonFile) | ||
} | ||
@@ -14,3 +14,3 @@ | ||
directory, | ||
report, | ||
jsonFile, | ||
} |
@@ -8,10 +8,10 @@ const { generate } = require('cucumber-html-reporter') | ||
const sanitize = require('sanitize-filename') | ||
const { directory, report } = require('./files') | ||
const { directory, jsonFile } = require('./files') | ||
module.exports = () => { | ||
if (!existsSync(report)) { | ||
if (!existsSync(jsonFile)) { | ||
log.info( | ||
`Cucumber report path should be passed using the -f command line argument`, | ||
) | ||
log.info(`Cucumber report not found at path ${report}`) | ||
log.info(`Cucumber report not found at path ${jsonFile}`) | ||
return false | ||
@@ -31,10 +31,19 @@ } | ||
const metadata = (() => { | ||
try { | ||
return readFileSync(jsonFile)[0].metadata | ||
} catch (error) { | ||
log.error('Error while reading meta data') | ||
} | ||
return undefined | ||
})() | ||
return generate({ | ||
theme: 'bootstrap', | ||
jsonFile: report, | ||
jsonFile, | ||
output: resolve(`${directory}/${reportName}.html`), | ||
reportSuiteAsScenarios: true, | ||
launchReport: true, | ||
metadata: readFileSync(report)[0].metadata, | ||
metadata, | ||
}) | ||
} |
@@ -5,4 +5,3 @@ const { sendEmail } = require('./app/emailer') | ||
// process.once('beforeExit', async () => { | ||
// await generateHtmlReport() | ||
// mailer() | ||
// sendEmail() | ||
// }) | ||
@@ -9,0 +8,0 @@ |
{ | ||
"name": "@nodebug/emailer", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"author": { | ||
@@ -5,0 +5,0 @@ "name": "Node Bug", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5618
155