weixin_33725126 2014-10-01 17:08 采纳率: 0%
浏览 27

在测试期间存根XHR2

Usually we go with Sinon when trying to stub/fake XHR. But recently we run into a bunch of problems with it when trying to fake XHR2.

It would seem that Sinon is not fully compatible with XHR2 implementation yet. A notable issue is empty xhr.response (not to be confused with xhr.responseText). This makes testing XHR2 response much more difficult.

Is there a better alternative out there for XHR2 testing? What's a good starting point for mocking/stubbing XHR2?

  • 写回答

0条回答 默认 最新

    报告相同问题?