You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in junit reporter, when task.result.duration's value is 0, the duration got undefined as fallback value by JavaScript's implicit conversion, which results in that generated report file will not got time attribute in <testcase> tag.
<testsuitesid=""name=""tests="1"failures="0"skipped="0"errors="0"time="0.014961999997496605">
<testsuitename="x"timestamp="2022-08-09T09:17:24.527Z"hostname=""tests="5"failures="0"errors="0"skipped="0"time="0.0070000000">
<!-- no time attribute was present -->
<testcaseclassname="x"name="should xxx">
</testcase>
</testsuite>
</testsuites>
In junit standard, time attribute should be kept even using value '0'. Also, this will cause some tools work incorrectly.
I'm not sure why the task.result.duration reveived value 0, but in some simple test cases(e.g. only one expect statement) it always appear, so I suspect that this is also a precision loss problem caused by JavaScript.
Describe the bug
Currently in junit reporter, when
task.result.duration
's value is 0, the duration got undefined as fallback value by JavaScript's implicit conversion, which results in that generated report file will not gottime
attribute in<testcase>
tag.The produced xml file:
In junit standard, time attribute should be kept even using value '0'. Also, this will cause some tools work incorrectly.
Use 0 as fallback value should fix this:
Reproduction
I'm not sure why the
task.result.duration
reveived value 0, but in some simple test cases(e.g. only one expect statement) it always appear, so I suspect that this is also a precision loss problem caused by JavaScript.System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: