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

Commit f500305

Browse files
author
Marcy Sutton
committed
fix: allow errors to be caught by mocha
1 parent 02ee730 commit f500305

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

lib/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,7 @@ AxeBuilder.prototype.analyze = function(callback) {
139139
callback(results);
140140
}
141141
resolve(results);
142-
})
143-
.catch(reject);
142+
});
144143
});
145144
});
146145
};

test/unit/index.js

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -308,29 +308,5 @@ describe('Builder', function () {
308308
done();
309309
});
310310
});
311-
312-
it('should catch errors', function (done) {
313-
var config = {};
314-
var Builder = proxyquire('../../lib/index', {
315-
'./inject': function (driver, source, config, cb) {
316-
cb(null, 'source-code');
317-
}
318-
});
319-
320-
new Builder({
321-
executeAsyncScript: function (callback, context, options) {
322-
return {
323-
then: function (cb) {
324-
throw new Error('oops!');
325-
}
326-
};
327-
}
328-
})
329-
.analyze()
330-
.catch(function(error) {
331-
assert.equal(error.message, 'oops!');
332-
done();
333-
});
334-
});
335311
});
336312
});

0 commit comments

Comments
 (0)