I have the following reporters in the protractor.conf file:
var promise1 = new Promise(function (resolve) {
reporter1.afterLaunch(resolve.bind(this, exitCode));
});
var promise2 = new Promise(function (resolve) {
reporter2.afterLaunch(resolve.bind(this, exitCode));
});
return Promise.all([promise1, promise2]);
Each of the above reporters have their own afterlaunch that would be expected to execute once the afterlaunch in the ptor.conf file is executed.
This is a part of the continuous integration job in Jenkins. So what's happening is that the promise resolves so the exit code of the process becomes 0, even when a test fails hence overwriting the exit code of the job. So even though its a legit failure the jenkins shows the entire job as PASSED. I need to preserve the original value of exitCode
that is being passed to the above reports for the jenkins job to function as expected. How can we prevent this?