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:05:52 UTC

[GitHub] brodybits commented on a change in pull request #485: Ensure test failure on unexpected promise resolution

brodybits commented on a change in pull request #485: Ensure test failure on unexpected promise resolution
URL: https://github.com/apache/cordova-ios/pull/485#discussion_r242974843
 
 

 ##########
 File path: 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(new Error('expected promise rejection')))
 
 Review comment:
   I would favor using done.fail('...') instead of done(new Error(...)) throughout this test script, like this:
   
   ```suggestion
                       .then(() => done.fail('expected promise rejection'))
   ```

----------------------------------------------------------------
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