Skip to content

Commit

Permalink
Merge pull request #1995 from ianwremmel/fix-xunit-hang
Browse files Browse the repository at this point in the history
make sure the xunit output dir exists before trying to write to it
  • Loading branch information
danielstjules committed Dec 9, 2015
2 parents 1192914 + d09c035 commit 3af1b8a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/reporters/xunit.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ var utils = require('../utils');
var inherits = utils.inherits;
var fs = require('fs');
var escape = utils.escape;
var mkdirp = require('mkdirp');
var path = require('path');

/**
* Save timer references to avoid Sinon interfering (see GH-237).
Expand Down Expand Up @@ -43,6 +45,7 @@ function XUnit(runner, options) {
if (!fs.createWriteStream) {
throw new Error('file output not supported in browser');
}
mkdirp.sync(path.dirname(options.reporterOptions.output));
self.fileStream = fs.createWriteStream(options.reporterOptions.output);
}

Expand Down

0 comments on commit 3af1b8a

Please sign in to comment.