jamesshore / quixote

CSS unit and integration testing
Other
848 stars 45 forks source link

Deprecated Sync XMLHttpRequest breaks #51

Closed rkichenama closed 6 years ago

rkichenama commented 6 years ago

While using v 0.12.5 and 0.13.0 with Jasmine 2.8.0, I am finding the beforeEach call to set up a frame fails to execute before any it block because QFrame attempts to test the existence of the src and stylesheet options via HEAD request. I get the deprecation message below and all my tests fail with a 'frame undefined' error.

[Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.

Is an existence check needed? Assuming a dev provides bad urls, shouldn't everything break obviously in the page pointing to the cause?

jamesshore commented 6 years ago

Thanks for bringing this to my attention. I'm looking at it now.

Which browser are you seeing this on?

jamesshore commented 6 years ago

Looking at this further, I don't think this issue is due to the use of synchronous XMLHttpRequest (although I admit that doing so is bad form). It's more likely that you're not calling beforeEach() properly. Are you using the done parameter?

Please share your beforeEach code.

jamesshore commented 6 years ago

I'm fairly certain that the issue you're seeing is unrelated to the synchronous XMLHttpRequest.

However, it was bad form to have that in the code, so I've released v0.14 of quixote that uses asynchronous XMLHttpRequests instead. It also makes several other small quality-of-life improvements to QFrame.

Please check your code against the new version and see if the issue is still present.

jamesshore commented 6 years ago

Closed due to lack of response.