Skip to content

Commit

Permalink
feat: allow custom reporters to be loaded (#155)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrocarrico authored and bcoe committed Mar 31, 2018
1 parent c13d273 commit 6d89cca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/istanbul-reports/index.js
Expand Up @@ -7,7 +7,13 @@ var path = require('path');
module.exports = {
create: function (name, cfg) {
cfg = cfg || {};
var Cons = require(path.join(__dirname, 'lib', name));
var Cons;
try {
Cons = require(path.join(__dirname, 'lib', name));
} catch (e) {
Cons = require(name);
}

return new Cons(cfg);
}
};
Expand Down

0 comments on commit 6d89cca

Please sign in to comment.