I have installed jsonjunit package of npm.I want to convert json file to junit xml - so that jenkins can read that file . My json file is like this :-
{"results":[ {"id":1136168, "startTime":"2017-05-12T15:11:07.834Z", "endTime":"2017-05-12T15:11:17.834Z", "status":0, "comment":"Test has run to completion", "logFile":"ftp://stormtest:stormtest@blr-strmtst-01:21/public/NET_TEST/Tools/flashUI_20170511_124701", "user":{"id":1032295,"name":"BLRTEST"}, "script":{"path":"public/NET_TEST//Tools//flashUI.py"}, "schedule":{"id":1136164}, "job":{"id":1136167}, "duts":[{"id":98113,"name":"7430_NET_II_1"}], "slots":[{"id":59,"number":2,"server":{"id":52,"name":"BLR-STRMTST-01"}}]}]}
I used the following command to convert the json to junit xml , as per instruction mentioned in https://www.npmjs.com/package/json-junit.But it throws error:
var dateFormatted = new Date(jsonData.stats.start), TypeError: Cannot read property 'start' of undefined at Object.convertJson (C:\Program Files\nodejs\node_modules\npm\node_modules
Please help.