Paramagnetic / newman-reporter-json-light

Newman reporter which mimics the built-in JSON reporter but only includes a few key items in the report.
5 stars 4 forks source link

Report generation fails if description is null #1

Open reftel opened 6 years ago

reftel commented 6 years ago

We have a collection with requests that lack description. The collection file has null values for the description field for these requests. When generating the report for a collection with such requests, newman-reporter-json-light fails with the following stack trace:

/home/magnus/node_modules/newman-reporter-json-light/lib/index.js:42
              'content': folderItem.request.description.content
                                                       ^

TypeError: Cannot read property 'content' of undefined
    at /home/magnus/node_modules/newman-reporter-json-light/lib/index.js:42:56
    at Array.forEach (native)
    at /home/magnus/node_modules/newman-reporter-json-light/lib/index.js:37:38
    at Array.forEach (native)
    at createLightSummary (/home/magnus/node_modules/newman-reporter-json-light/lib/index.js:35:38)
    at EventEmitter.<anonymous> (/home/magnus/node_modules/newman-reporter-json-light/lib/index.js:79:37)
    at EventEmitter.emit (/home/magnus/opt/newman-3.3.0/lib/node_modules/newman/node_modules/eventemitter3/index.js:151:33)
    at done (/home/magnus/opt/newman-3.3.0/lib/node_modules/newman/lib/run/index.js:199:29)
    at /home/magnus/opt/newman-3.3.0/lib/node_modules/newman/node_modules/postman-runtime/lib/backpack/index.js:56:34
    at PostmanCollectionRun._process (/home/magnus/opt/newman-3.3.0/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/run.js:109:20)
ookiisan commented 5 years ago

I'm in trouble with this behavior too:


    at /usr/local/lib/node_modules/newman-reporter-json-light/lib/index.js:37:30
    at Array.forEach (<anonymous>)
    at createLightSummary (/usr/local/lib/node_modules/newman-reporter-json-light/lib/index.js:35:38)
    at EventEmitter.<anonymous> (/usr/local/lib/node_modules/newman-reporter-json-light/lib/index.js:79:37)
    at EventEmitter.emit (/usr/local/lib/node_modules/newman/node_modules/eventemitter3/index.js:203:33)
    at done (/usr/local/lib/node_modules/newman/lib/run/index.js:277:29)
    at /usr/local/lib/node_modules/newman/node_modules/postman-runtime/lib/backpack/index.js:56:34
    at PostmanCollectionRun._process (/usr/local/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/run.js:161:13)
    at PostmanCollectionRun.<anonymous> (/usr/local/lib/node_modules/newman/node_modules/postman-runtime/lib/runner/run.js:166:76)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)```
safarviktor commented 3 years ago

Same issue, different object

C:\Users\xxxxxxxxxxxxx\AppData\Roaming\npm\node_modules\newman-reporter-json-light\lib\index.js:22
                    'content': failureReport.parent.description.content
                                                                ^

TypeError: Cannot read property 'content' of undefined
    at C:\Users\no-viksafa-01\AppData\Roaming\npm\node_modules\newman-reporter-json-light\lib\index.js:22:65