dpogue commented on code in PR #285:
URL: https://github.com/apache/cordova-paramedic/pull/285#discussion_r2611445806


##########
lib/paramedic.js:
##########
@@ -244,17 +249,17 @@ class ParamedicRunner {
                     })
                 ]);
             })
-            .then((results) => {
-                return results[1];
-            })
-            .fin((result) => {
-                return runProcess
-                    ? Q.Promise((resolve) => {
+            .then((results) => results[1])
+            .then((result) => {

Review Comment:
   Is this meant to be `finally`?



##########
lib/paramedic.js:
##########
@@ -81,15 +79,21 @@ class ParamedicRunner {
                     logger.normal('Start building app and running tests at ' + 
(new Date()).toLocaleTimeString());
                 }
                 // run tests
-                return this.runTests();
+                return Promise.race([
+                    this.runTests(),
+                    new Promise((resolve, reject) =>
+                        setTimeout(() => reject(
+                            new Error(`[paramedic] Tests failed to complete in 
${this.config.getTimeout()} ms.`)
+                        ), this.config.getTimeout())
+                    )
+                ]);
             })
-            .timeout(this.config.getTimeout(), 'Timed out after waiting for ' 
+ this.config.getTimeout() + ' ms.')
             .catch((error) => {
                 logger.error(error);
                 console.log(error.stack);
-                throw new Error(error);
+                throw error;
             })
-            .fin((result) => {
+            .then((result) => {

Review Comment:
   Is this meant to be `finally`?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to