Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jtest-unit reporter] Error: stackTrace.split is not a function with valid JUNIT XML #506

Open
ncocaign opened this issue Jul 19, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ncocaign
Copy link

ncocaign commented Jul 19, 2024

Describe the bug

with valid JUNIT XML passing the XSD validation (https://github.com/behave/behave/blob/main/etc/junit.xml/junit-4.xsd).

To Reproduce

Steps to reproduce the behavior:
Use jtest-unit reporter an result XML with or tag with attribute "message"

Expected behavior

Error: stackTrace.split is not a function

Screenshots

Additional context

here a result which cannot be parsed:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="1" failures="1" disabled="0" errors="0" time="0.001" name="Failure">
  <testsuite name="Test" tests="6" failures="1" disabled="0" errors="0" time="0.001">
    <testcase name="Test" status="run" time="0" classname="Fails">
      <failure message="error" type=""><![CDATA[error.cpp:01
      Expected: true
      Which is: false >]]></failure>
    </testcase>
  </testsuite>
</testsuites>

Potential fix:

at

const details = tc.failure[0]

replace const details = tc.failure[0]; with const details = tc.failure[0] || tc.failure[0]._;

@ncocaign ncocaign added the bug Something isn't working label Jul 19, 2024
abhay-agarwal added a commit to abhay-agarwal/test-reporter that referenced this issue Jul 29, 2024
@BryanCrotazGivEnergy
Copy link

I'm seeing the same fault - is there a fix yet?

@jozefizso
Copy link
Collaborator

A pull request with code changes and tests is welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants