Skip to content

Commit

Permalink
Merge pull request #1882 from danielstjules/fragile
Browse files Browse the repository at this point in the history
Fix fragile xunit reporter spec
  • Loading branch information
danielstjules committed Sep 11, 2015
2 parents a3ae593 + d7e4605 commit f023018
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/integration/reporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,21 @@ describe('reporters', function() {

var args = ['--reporter=xunit', '--reporter-options', 'output=' + tmpFile];
var expectedOutput = [
'<testcase classname="suite" name="test1" time="0"/>',
'<testcase classname="suite" name="test2" time="0"/>',
'<testcase classname="suite" name="test1" time="',
'<testcase classname="suite" name="test2" time="',
'</testsuite>'
].join('\n');
];

run('passing.js', args, function(err, result) {
if (err) return done(err);

var xml = fs.readFileSync(tmpFile, 'utf8');
fs.unlinkSync(tmpFile);

assert(xml.indexOf(expectedOutput) !== -1, 'Did not output all xml');
expectedOutput.forEach(function(line) {
assert(xml.indexOf(line) !== -1, 'XML did not contain ' + line);
});

done(err);
});
});
Expand Down

0 comments on commit f023018

Please sign in to comment.