ember-cli-deploy-original icon indicating copy to clipboard operation
ember-cli-deploy-original copied to clipboard

Stop using .catch() in tests

Open achambers opened this issue 11 years ago • 0 comments

Check all tests using .catch(). This is because it can hide failed assertions.

By using .catch any failed assertions are seen as a reject and go in to the .catch(). Where as, if the reject function was specified instead, you will see output of the failed assertiong.

eg.

Change this:

subject.run()
  .then(function() {
    //fail an assertion
  })
  .catch(function() {
    //assert that it didn't get here
  });

To this:

subject.run()
  .then(function() {
    //fail an assertion
  }, function() {
    //assert that it didn't get here
  });

achambers avatar Oct 28 '14 21:10 achambers