Skip to content

Commit 25aeae1

Browse files
committed
test_runner: add junit file attribute support
Add file attribute to JUnit testcase elements when file information is available in test event data.
1 parent 767cea8 commit 25aeae1

File tree

1 file changed

+3
-0
lines changed
  • lib/internal/test_runner/reporter

1 file changed

+3
-0
lines changed

lib/internal/test_runner/reporter/junit.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ module.exports = async function* junitReporter(source) {
116116
} else {
117117
currentTest.tag = 'testcase';
118118
currentTest.attrs.classname = event.data.classname ?? 'test';
119+
if (event.data.file) {
120+
currentTest.attrs.file = event.data.file;
121+
}
119122
if (event.data.skip) {
120123
ArrayPrototypePush(currentTest.children, {
121124
__proto__: null, nesting: event.data.nesting + 1, tag: 'skipped',

0 commit comments

Comments
 (0)