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

1.8.1 breaks existing specs #396

Closed
xcambar opened this issue Feb 10, 2014 · 8 comments
Closed

1.8.1 breaks existing specs #396

xcambar opened this issue Feb 10, 2014 · 8 comments

Comments

@xcambar
Copy link

xcambar commented Feb 10, 2014

I've tried to upgrade to 1.8.1, but since then, I have the following error:

Here's the stack trace:

TypeError: '[object ProgressEventConstructor]' is not a constructor (evaluating 'new ProgressEvent("progress", {loaded: 100, total: 100})')
            at readyStateChange (/Users/xav/code/Hull.io/hull-js/node_modules/sinon/pkg/sinon.js:3663)
            at setResponseBody (/Users/xav/code/Hull.io/hull-js/node_modules/sinon/pkg/sinon.js:3814)
            at respond (/Users/xav/code/Hull.io/hull-js/node_modules/sinon/pkg/sinon.js:3824)
            at /Users/xav/code/Hull.io/hull-js/spec/remote/handler_spec.js:66
//and so on...

The line in the specs where the error originates is:

requests[0].respond(400, { 'Content-Type': 'application/json' }, '{}');

While a fix is pending, I will stay with 1.7.3 ;)

Best,

@fearphage
Copy link
Member

Why didn't you send back a custom sinon.Event like everything else? This would allow XHR#upload events to be tested. Phantomjs currently doesn't have the ProgressEvent constructor, but my tests are going well using the sinon.Event. I did a find and replace of ProgressEvent with sinon.Event from the original commit.

@xcambar
Copy link
Author

xcambar commented Feb 12, 2014

Following @fearphage comment, I should have ben more specific and told that specs were failing using Karma + PhantomJS.

@cjohansen
Copy link
Contributor

@fearphage Mostly because I didn't write this code and made the most conservative change possible. Looking at it, I still think it's the right decision, cause I don't want Sinon to support something in an environment that doesn't also support the thing it's faking out (like ProgressEvent)

@mikehstrauss
Copy link

Has this issue been resolved? I just tried 1.8.1 and still see the problem.

@xcambar
Copy link
Author

xcambar commented Feb 27, 2014

Then you should try 1.8.2 :p

@mikehstrauss
Copy link

I also tried 1.8.2, still an issue. Using Jasmine and Phantomjs. 1.7.3 works fine.

@xcambar
Copy link
Author

xcambar commented Feb 27, 2014

Just double-checked. I too still have the issue.

@cjohansen
Copy link
Contributor

Will push 1.8.3 shortly

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

4 participants