UNPKG

xunit-file

Version:

Basically the same reporter as mocha's xunit reporter, but writes the output in a file.

19 lines (17 loc) 615 B
var runFixture = require('./lib/util').runFixture , fs = require('fs'); describe('output', function () { afterEach(function () { delete process.env.XUNIT_FILE; }); it('should write the report to the path specified by the XUNIT_FILE environment variable', function (done) { process.env.XUNIT_FILE = '_tmp/out/target.xml'; runFixture('success', function (result) { if (result.stderr) { return done(new Error (result.stderr)) } var reportExists = fs.existsSync('_tmp/out/target.xml'); (reportExists) ? done() : done(new Error('Report not found')); }) }); });