jemishgopani/wdio-json-reporter

Cannot read poperty 'suites' of undefined

tpronk opened this issue · 3 comments

Hey!

I'm a bit inexperienced, so please be gentle :).

Using version 2.0.0, I followed the steps in the README to write the json logs to individual files and then merge them together:

reporters: [
  'dot',
  ['json',{
      outputDir: './Results'
  }]
],
const mergeResults = require('wdio-json-reporter/mergeResults')
mergeResults('./Results', 'wdio-json-*', 'wdio-custom-filename.json')

I got an error "cannot read property suites of undefined". Diving a bit deeper, I spotted that the filenames are named "wdio-0-0-json-reporter.log" etc., so I could fix it by changing the script above to...

const mergeResults = require('wdio-json-reporter/mergeResults')
mergeResults('./Results', 'wdio-*', 'wdio-custom-filename.json')

@tpronk It looks like you have found an error in the documentation. Thanks for letting me know!

Happy to help!

Stale issue message