Domanda

I'm migrating a framework Specs to run with Karma/Jasmin/Grunt and Travis/SauceLabs

While running the specs I get errors in all Ajax specs for some browsers.

PhantomJS/Opera/Chrome && FF are all green. No errors.

Safari give this same error in all those 13 Specs in Sinon.js:

TypeError: '[object ProgressEventConstructor]' is not a constructor 
    (evaluating 'new ProgressEvent("progress", {loaded: 100, total: 100})')

In IE I get another text for the same error:

TypeError: Object doesn't support this action

Any idea what I might be missing?

È stato utile?

Soluzione 2

Fixed with updating the version of Sinon.js

Att the moment the new version was not released yet, plus that I concated sinon-IE into it. So if anyone needs its here.

Altri suggerimenti

Sinon appears to be checking the following...

var supportsProgress = typeof ProgressEvent !== "undefined";

I think some of those browsers return an empty object for ProgressEvent instead of undefined which throws off this check.

I've manually changed my code because i don't care about the ProgressEvent (this was easy but isn't very practical for CI purposes). I'm looking into changing the value of supportsProgress in my tests to avoid the issue entirely.

UPDATE This was happening to me because i was using an older version of SinonJS in my tests. It's FakeXMLHttpRequest object was causing the ProgressEvent to be created during the readyState updated process.

I talked to the folks over at SinonJS. They recommended going to version 1.9.0. This appears to have solved all my problems :)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top