enzymejs/enzyme

Silently failing tests with JSDOM

Open

#621 geöffnet am 3. Okt. 2016

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)JavaScript (19.979 Stars) (2.016 Forks)batch import
docshelp wanted

Beschreibung

This is likely closely related to #543.

My mocha test suite runs after a setup script.

The problem is that examples fail silently if document.defaultView.XMLHttpRequest is assigned to global.XMLHttpRequest.

Similarly, I worked around it with

if (typeof global[property] === 'undefined' && property !== 'XMLHttpRequest') {
  global[property] = document.defaultView[property];
}

I can't really pinpoint the root cause of this, but if nothing else it may be worthwhile to update the JSDOM guide.

Contributor Guide