Version
v24.4.1
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
test
What steps will reproduce the bug?
-
Create any failing test, like
import { suite, test } from "node:test";
await suite('suiteName', () => {
test('testName', () => {
throw new Error('Failed')
});
});
-
Run the test via console
node --test --test-reporter=junit ".\src\junit.test.mts"
-
Check the report from stdout.
How often does it reproduce? Is there a required condition?
Always. Regardless the suite or test function arguments.
What is the expected behavior? Why is that the expected behavior?
A failed testcase should have file element with source code file of this test case, like "src/junit.test.mts".
For example, GitLab uses file when rendering the test reports: https://docs.gitlab.com/ci/testing/unit_test_reports/#copy-failed-test-names
What do you see instead?
<testcase name="testName" time="0.000414" classname="test" failure="Failed">
Additional information
No response
Version
v24.4.1
Platform
Subsystem
test
What steps will reproduce the bug?
Create any failing test, like
Run the test via console
Check the report from stdout.
How often does it reproduce? Is there a required condition?
Always. Regardless the suite or test function arguments.
What is the expected behavior? Why is that the expected behavior?
A failed
testcaseshould havefileelement with source code file of this test case, like"src/junit.test.mts".For example, GitLab uses
filewhen rendering the test reports: https://docs.gitlab.com/ci/testing/unit_test_reports/#copy-failed-test-namesWhat do you see instead?
<testcase name="testName" time="0.000414" classname="test" failure="Failed">Additional information
No response