You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/12/19 16:21:34 UTC

[GitHub] brodybits closed pull request #485: Ensure test failure on unexpected promise resolution

brodybits closed pull request #485: Ensure test failure on unexpected promise resolution
URL: https://github.com/apache/cordova-ios/pull/485
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/tests/spec/component/versions.spec.js b/tests/spec/component/versions.spec.js
index fbc8dc25a..0008a97cf 100644
--- a/tests/spec/component/versions.spec.js
+++ b/tests/spec/component/versions.spec.js
@@ -25,38 +25,40 @@ if (process.platform === 'darwin') {
     describe('versions', function () {
         describe('get_tool_version method', () => {
             it('should not have found tool by name.', (done) => {
-                versions.get_tool_version('unknown').catch((error) => {
-                    expect(error).toContain('is not valid tool name');
-                    done();
-                });
+                versions.get_tool_version('unknown')
+                    .then(() => done.fail('expected promise rejection'))
+                    .catch((error) => {
+                        expect(error).toContain('is not valid tool name');
+                        done();
+                    });
             });
 
             it('should find xcodebuild version.', (done) => {
                 versions.get_tool_version('xcodebuild').then((version) => {
                     expect(version).not.toBe(undefined);
                     done();
-                });
+                }).catch(() => done.fail('expected promise resolution'));
             });
 
             it('should find ios-sim version.', (done) => {
                 versions.get_tool_version('ios-sim').then((version) => {
                     expect(version).not.toBe(undefined);
                     done();
-                });
+                }).catch(() => done.fail('expected promise resolution'));
             });
 
             it('should find ios-deploy version.', (done) => {
                 versions.get_tool_version('ios-deploy').then((version) => {
                     expect(version).not.toBe(undefined);
                     done();
-                });
+                }).catch(() => done.fail('expected promise resolution'));
             });
 
             it('should find pod version.', (done) => {
                 versions.get_tool_version('pod').then((version) => {
                     expect(version).not.toBe(undefined);
                     done();
-                });
+                }).catch(() => done.fail('expected promise resolution'));
             });
         });
     });


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org