move system output into the testcase elements in junit xml

This commit is contained in:
Spencer Alger
2015-03-30 11:43:51 -07:00
parent 7d837f704c
commit 79a53767e3
2 changed files with 29 additions and 7 deletions

View File

@ -136,8 +136,20 @@ function JenkinsReporter(runner) {
name: test.title,
time: test.duration,
pass: test.state === 'passed',
test: test
test: test,
stdout: stack[0].stdout,
stderr: stack[0].stderr
});
stack[0].stdout = stack[0].stderr = '';
}
});
runner.on('hook end', function (hook) {
if (hook.title.indexOf('"after each"') > -1 && stack[0] && stack[0].results.length) {
var result = _.last(stack[0].results);
result.stdout += stack[0].stdout;
result.stderr += stack[0].stderr;
stack[0].stdout = stack[0].stderr = '';
}
});