Skip to content

Commit f0aa073

Browse files
Han5991nodejs-github-bot
authored andcommitted
test_runner: add junit file attribute support
Add file attribute to JUnit testcase elements when file information is available in test event data. PR-URL: #59432 Fixes: #59422 Reviewed-By: Moshe Atlow <[email protected]> Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Pietro Marchini <[email protected]>
1 parent 1f95d39 commit f0aa073

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)