Closed NaveenThiyagarajan closed 4 years ago
Ok, went through the code: In src/mergeResults.js
function getDataFromFiles (dir, filePattern) {
const fileNames = fs.readdirSync(dir).filter(file => file.match(filePattern))
const data = []
fileNames.forEach(fileName => {
data.push(JSON.parse(fs.readFileSync(`${dir}/${fileName}`)))
})
return data
}
I feel there should be a check before allowing JSON.parse
to parse an empty file.
Stale issue message
Issue: When there are feature files which are not used as part of execution because of no matching tagExpression, there is still a empty JSON report generated for that feature file. The file is completely empty.
And in the end when we call
mergeResults(process.cwd() + '/reports/json/', 'results-*')
, it fails with the error:Here are the version details:
Please let me know if you need any more info or if i am missing anything.