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

Handle case when testsuites is not the root element of the JUnit xml file #85

Merged
merged 2 commits into from
Apr 30, 2024

Conversation

JakeFDev
Copy link
Contributor

Updates the junit parsing to account for cases where tools may not utilize <testsuites> as the root element.

Without this change, trying to parse a junit xml file that omits the root testsuites element results in this error:

Parse JUnit report. Cannot read properties of undefined (reading '$')

As explained on this page, the JUnit xml format has no official specification and many tools and projects have minor variations such as this. Common JUnit XML Format & Examples

@MishaKav
Copy link
Owner

Great improvement, I will merge it soon and release a new version.
Thank you.

@MishaKav MishaKav changed the base branch from main to fix-root-element-at-junit April 30, 2024 07:22
@MishaKav MishaKav merged commit 11c181e into MishaKav:fix-root-element-at-junit Apr 30, 2024
MishaKav added a commit that referenced this pull request Apr 30, 2024
* Handle case when testsuites is not the root element of the JUnit xml file (#85)

* Update junit.ts

* Update junit.test.ts

* build

* 1.0.26

* bump prod packages

* changelog

---------

Co-authored-by: Jacob Fulton <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants