Skip to content

Tests/rewrite array matches#1444

Merged
zorkow merged 5 commits intodevelopfrom
tests/rewrite_array_matches
Mar 23, 2026
Merged

Tests/rewrite array matches#1444
zorkow merged 5 commits intodevelopfrom
tests/rewrite_array_matches

Conversation

@zorkow
Copy link
Member

@zorkow zorkow commented Mar 13, 2026

This PR removes all occurrences of toXmlArrayMatch from the Tag and Tex tests.

This now allows us to get rid of all helper functions related to XML matching, which was done via conversion to JSON. This has the advantage that

  1. we can get rid of the dependency of the xml-js library,
  2. tests run faster as we skip the xml2json conversion entirely.

This completes the refactoring of the tests to use snapshots instead of customised XML comparison.

@zorkow zorkow requested a review from dpvc March 13, 2026 10:02
Copy link
Member

@dpvc dpvc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Slight reformatting might be nice, but not crucial.

Comment on lines +607 to +608
await page2mml('<p>$$a=b\\label{eq1}\\tag{1}$$</p><p>Refer to \\eqref{eq1}</p>')).
toMatchSnapshot();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if the ). from the end of line 607 shouldn't be moved to the beginning of 608.

Similarly for the others. Some I think can be put on a single line, like 177+178.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran prettier on the Tag.test.ts file.
As we are now using snapshots we should include the test files in our prettier/linter routine.

Base automatically changed from tests/rewrite_remaining_xmlmatches to develop March 23, 2026 11:41
@zorkow zorkow merged commit 5629a28 into develop Mar 23, 2026
1 check passed
@zorkow zorkow deleted the tests/rewrite_array_matches branch March 23, 2026 12:01
@codecov
Copy link

codecov bot commented Mar 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.49%. Comparing base (71f6868) to head (a1aa720).
⚠️ Report is 9 commits behind head on develop.

Additional details and impacted files
@@            Coverage Diff             @@
##           develop    #1444     +/-   ##
==========================================
  Coverage    86.49%   86.49%             
==========================================
  Files          340      340             
  Lines        86044    86044             
  Branches      3190     4833   +1643     
==========================================
  Hits         74425    74425             
+ Misses       11619    11595     -24     
- Partials         0       24     +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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