-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Open
Description
Version
v24.4.1
Platform
Microsoft Windows NT 10.0.19045.0 x64
Subsystem
test
What steps will reproduce the bug?
-
Create any test file, like
import { equal } from "node:assert/strict"; import { test } from "node:test"; const value = 1; await test("testName", () => { equal(value, 0, `The value must be 0`); });
-
Run the test via console
node --test --test-reporter=junit ".\junit.test.mts"
-
Check the report from stdout.
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior? Why is that the expected behavior?
failure
element should have a correctmessage
attribute. I guess having"The value must be 0"
in this example would be finetestcase
element shouldn't have thefailure
attribute.
What do you see instead?
failure
in testcase
element and message
in failure
element are "The value must be 01 !== 0"
:
<testcase name="testName" time="0.002234" classname="test" failure="The value must be 01 !== 0">
<failure type="testCodeFailure" message="The value must be 01 !== 0">
Error [ERR_TEST_FAILURE]: The value must be 0
1 !== 0
at async file:///C:/code/project/junit.test.mts:6:1 {
code: 'ERR_TEST_FAILURE',
failureType: 'testCodeFailure',
cause: AssertionError [ERR_ASSERTION]: The value must be 0
1 !== 0
at TestContext.<anonymous> (file:///C:/code/project/junit.test.mts:7:3)
at Test.runInAsyncScope (node:async_hooks:214:14)
at Test.run (node:internal/test_runner/test:1062:25)
at Test.start (node:internal/test_runner/test:959:17)
at startSubtestAfterBootstrap (node:internal/test_runner/harness:332:17)
at async file:///C:/code/project/junit.test.mts:6:1 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: 1,
expected: 0,
operator: 'strictEqual'
}
}
</failure>
</testcase>
Additional information
No response
Metadata
Metadata
Assignees
Labels
No labels