Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
fix: allow errors to be caught by mocha
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcy Sutton committed Dec 19, 2017
1 parent 02ee730 commit f500305
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
3 changes: 1 addition & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ AxeBuilder.prototype.analyze = function(callback) {
callback(results);
}
resolve(results);
})
.catch(reject);
});
});
});
};
Expand Down
24 changes: 0 additions & 24 deletions test/unit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,29 +308,5 @@ describe('Builder', function () {
done();
});
});

it('should catch errors', function (done) {
var config = {};
var Builder = proxyquire('../../lib/index', {
'./inject': function (driver, source, config, cb) {
cb(null, 'source-code');
}
});

new Builder({
executeAsyncScript: function (callback, context, options) {
return {
then: function (cb) {
throw new Error('oops!');
}
};
}
})
.analyze()
.catch(function(error) {
assert.equal(error.message, 'oops!');
done();
});
});
});
});

0 comments on commit f500305

Please sign in to comment.