fix(report): waiting promise resolve in onExist method fix #418#419
fix(report): waiting promise resolve in onExist method fix #418#419anthony-redFox merged 1 commit intokarma-runner:masterfrom
Conversation
3d5372e to
9bc1103
Compare
…er#418 onComplete are async method which should bw complete in onExit method
| return | ||
| } | ||
| if (typeof config._onExit === 'function') { | ||
| config._onExit(done) |
There was a problem hiding this comment.
Not sure where this function gets defined or where it's used, but it won't be called in case exitCode is 1.
See #420 for my approach, which still calls it.
There was a problem hiding this comment.
Are you sure that will be useful to call callback onExit? custom code can call with 1 or 0 too but you are ignore it.
There was a problem hiding this comment.
Build will be failed. Is matter to execute onExit method?
There was a problem hiding this comment.
I don't know where _onExit is defined or used, but with this change it's not called anymore in case the exitCode is 1. That's what I wanted to note here.
| } | ||
|
|
||
| this.onExit = async function (done) { | ||
| const results = await promiseComplete |
There was a problem hiding this comment.
There is no error handling by karma in case promiseComplete rejects. Karma doesn't expect the onExit handlers to return a promise. I would suggest using plain old then to handle success/error. See my code in #420
There was a problem hiding this comment.
await works with success only, if will be error the code onExit will be failed
There was a problem hiding this comment.
onExit is called sync by the karma-runner and expects the callback to be invoked. It doesn't expect a promise to be returned. That's why I suspect that a rejection would result into an unhandled Promise rejection.
|
🎉 This PR is included in version 2.0.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
onComplete are async method which should bw complete in onExit method