Giter VIP home page Giter VIP logo

Comments (5)

mnahkies avatar mnahkies commented on June 2, 2024

When running tests in node using JSDom then I believe this is a deficiency in https://github.com/jindw/xmldom which appears to be a dead project.

However, nise does not seem to check for parsererror tags, which would normally be returned in an error document by a browser (ref: https://developer.mozilla.org/en-US/docs/Web/API/DOMParser) - rather than an exception being thrown as nise seems to expect.

It would seem sensible for nise to check for parsererror and return null if found here https://github.com/sinonjs/nise/blob/master/lib/fake-xhr/index.js#L319-L322 - which I believe would solve this issue when run in a browser.

Eg:

(new DOMParser()).parseFromString('!!!<xml></xml>', 'text/xml').getElementsByTagName('parsererror').length;
1

See also https://stackoverflow.com/questions/11563554/how-do-i-detect-xml-parsing-errors-when-using-javascripts-domparser-in-a-cross

from nise.

stale avatar stale commented on June 2, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

from nise.

fatso83 avatar fatso83 commented on June 2, 2024

Should have been fixed by #50.

from nise.

fatso83 avatar fatso83 commented on June 2, 2024

@mnahkies Want to check that this works as you think before we cut a new release?

Clone, npm link in the nise repo, and do npm link nise in your project repo

from nise.

mnahkies avatar mnahkies commented on June 2, 2024

@fatso83 sorry I'm travelling for the next month or so with limited computer access. I had a glance over the pull request and it looked fine to me

from nise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.