mediawiki.api.test: Refactor to embrace async
authorTimo Tijhof <krinklemail@gmail.com>
Sat, 12 Mar 2016 02:15:14 +0000 (02:15 +0000)
committerKrinkle <krinklemail@gmail.com>
Mon, 14 Mar 2016 17:17:10 +0000 (17:17 +0000)
commit07032195b7fc671083e2e5a793a3846c0e15890d
tree659509933d4cb202f849340fe09801c21d6480b6
parentd7a2302a315b71f8c2ca289c4aca0ff3513fa7cf
mediawiki.api.test: Refactor to embrace async

This was using lots of synchronous hacks but those don't work in newer
versions of Sinon.JS (and only worked by accident up until now).

The test will still run pretty quick, but it will yield to some extend because
mw.Api and jQuery.ajax both create XHR objects with async=true.

* Remove redundant QUnit.expect() calls (deprecated).
* Make use of QUnit's new Promise-return feature.
  This simplifies some tests by no longer having to call async() or start()
  manually when only dealing with a single promise.

This blocks upgrade of Sinon.JS.

Change-Id: I08b08ea3c3e8b41f4aea50d86b2c9dc0f579ba67
tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js