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

Differences in attribute formatting are not ignored #17

Open
h4l opened this issue Sep 23, 2019 · 0 comments
Open

Differences in attribute formatting are not ignored #17

h4l opened this issue Sep 23, 2019 · 0 comments

Comments

@h4l
Copy link

h4l commented Sep 23, 2019

This assertion fails:

const regularAttributes = `<foo c="3" a="1" b="2"></foo>`
    const wrappedAttributes = `\
<foo a="1"
     c="3"
     b="2"></foo>`
    expect(regularAttributes).toEqualXML(wrappedAttributes)
h4l added a commit to h4l/jest-xml-matcher that referenced this issue Sep 23, 2019
h4l added a commit to h4l/jest-xml-matcher that referenced this issue Sep 23, 2019
It's now more robust, pretty-data didn't normalise XML properly (e.g.
wrapped attributes were not normalised).

Now all whitespace is stripped and the document elements re-indented
(though respecting xml:space="preserve"). The XML is serialised with
C14N (https://www.w3.org/TR/2001/REC-xml-c14n-20010315) making it safe
to compare as character strings.

This fixes: kbiedrzycki#17
mchesterkadwell pushed a commit to cambridge-collection/cudl-pack that referenced this issue Mar 3, 2021
There's currently a bug in jest-xml-matcher resulting it it treating
differences in indentation between XML files as content differences:
    kbiedrzycki/jest-xml-matcher#17

Until this is fixed the compared XML needs to have the same attribute
formatting.
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

No branches or pull requests

1 participant