Improve node port test for exit process on error.
@@ -43,12 +43,15 @@ const waitForMocha = async () => {
module.exports = {
main: async () => {
+ try {
// Run the tests
- const failures = await waitForMocha();
-
- // TODO: This seems it is not working
- process.exitCode = failures ? 1 : 0;
-
- return process.exitCode;
+ await waitForMocha();
+ } catch (failures) {
+ if (failures !== 0) {
+ process.exit(1);
+ }
+ }
+
+ return 0;
},
};
