nordcloud/serverless-mocha-plugin

using `--exit` flag returns exitCode 0 even if tests failed

shreyansjain opened this issue · 1 comments

Hi,
I recently installed the latest serverless-mocha-plugin (v1.9.0) that has a support for --exit flag (yay) to exit after the test run is completed.
However, I noticed that, even though the mocha tests failed, the exitCode was still 0.
This has direct implications when running in CI environment, since the exit code is 0 and CI thinks, the run was successful.

Closing this issue, since I was using async/await and one of the promise object was expecting something which caused mocha to not exit.
For context, I should be ending the pg-pool connection instead of just leaving at releasing the db_client.