Skip to content

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

Closed

Description

@ncocaign

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]._;

Activity

  1. added
    bug
    on Jul 19, 2024
  2. added a commit that references this issue on Jul 29, 2024
  3. BryanCrotazGivEnergy commented on Oct 16, 2024

    @BryanCrotazGivEnergy

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

  4. jozefizso commented on Oct 16, 2024

    @jozefizso
    Collaborator

    A pull request with code changes and tests is welcome.

  5. removed their assignment
    on Feb 7, 2025
  6. Jurredr commented on Mar 4, 2025

    @Jurredr

    Can this issue please be fixed? Encountering the same issue here.

  7. jozefizso commented on Mar 4, 2025

    @jozefizso
    Collaborator

    Hi @Jurredr, this is an open source project, if you know how to fix this a PR is welcome.

  8. cmonaghan1 commented on Mar 11, 2025

    @cmonaghan1
    Contributor

    I've made a PR based on @ncocaign suggestion 🤷

  9. added a commit that references this issue on Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions