diff --git a/lib/reporters/xunit.js b/lib/reporters/xunit.js index 08f7b4cac3..b46035ed94 100644 --- a/lib/reporters/xunit.js +++ b/lib/reporters/xunit.js @@ -30,6 +30,7 @@ var clearInterval = global.clearInterval; exports = module.exports = XUnit; + /** * Initialize a new `XUnit` reporter. * @@ -43,7 +44,7 @@ function XUnit (runner, options) { var tests = []; var self = this; - if (options.reporterOptions && options.reporterOptions.output) { + if (options && options.reporterOptions && options.reporterOptions.output) { if (!fs.createWriteStream) { throw new Error('file output not supported in browser'); }