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:
[email protected]


With regards,
Apache Git Services

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

Reply via email to