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

Adding 'deep' option in order to compare while ignoring whitespace in text nodes #2

Merged
merged 2 commits into from
Dec 30, 2014

Conversation

susomartinez
Copy link

As the title says, currently an XML like:

<tag>
    Text content
</tag>

won't be equal to

<tag>Text content</tag>

So I just added the option to use the 'deep' flag in order to ignore whitespace at the beginning and end of the text nodes. It is done just setting to true the trim option in the xml2js parser.

Now, you can use expect(formattedXml).xml.to.deep.equal(unformattedXml) in order to ignore the whitespace or keep using expect(formattedXml).xml.to.not.equal(unformattedXml) in order to taking it into account.

@krampstudio
Copy link
Owner

I'll review and merge that

@krampstudio krampstudio merged commit 63188e9 into krampstudio:master Dec 30, 2014
@krampstudio
Copy link
Owner

published in 0.3.0

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