Skip to content

Commit

Permalink
add check for total request failure
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed May 31, 2018
1 parent e221130 commit 429da3b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/management/jobs.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,19 @@ describe('JobsManager', function() {
.catch(done.bind(null, null));
});

it('should pass request errors to the promise catch handler', function(done) {
nock.cleanAll();

var request = nock(API_URL)
.post('/jobs/users-imports')
.replyWithError('printer on fire');

this.jobs.importUsers(data).catch(function(err) {
expect(err.message).to.equal('printer on fire');
done();
});
});

it('should pass HTTP errors to the promise catch handler', function(done) {
nock.cleanAll();

Expand Down

0 comments on commit 429da3b

Please sign in to comment.