Conversation
lootic
left a comment
There was a problem hiding this comment.
Found a few cosmetic things that can be fixed if you like.
| } | ||
|
|
||
| function deleteTestJob(testjobId) { | ||
| let url = config.server + '/api/v1/testjobs'+ '/' + testjobId + '/delete'; |
There was a problem hiding this comment.
The slash can be part of the first string and doesnt need to be concateneted seperately.
'/api/v1/testjobs'+ '/' + testjobId + '/delete';
->
'/api/v1/testjobs/' + testjobId + '/delete'
|
|
||
| function deleteTestJob(testjobId) { | ||
| let url = config.server + '/api/v1/testjobs'+ '/' + testjobId + '/delete'; | ||
| util.output('Deleting job: '+testjobId); |
There was a problem hiding this comment.
formatting, add space around operators
| util.output('Deleting job: '+testjobId); | ||
| request.delete(url) | ||
| .auth(config.username, config.password) | ||
| .accept('application/junit+xml') |
There was a problem hiding this comment.
This accept looks weird to me, I think it could be application/json, since json is what we return when there is an error. On success we don't return any data. Same goes for cancel(which I know you havent changed but I think it can be fixed too).
| if (('status' in err) && ('message' in result.body)) { | ||
| switch (err['status']) { | ||
| case 403: | ||
| util.error(err['status'] + ': ' + result.body['message']); |
There was a problem hiding this comment.
This one is does the same as the default-case. So it can be removed. Maybe we dont need the switch at all?
No description provided.