mediawiki.api.test: Use sinon sandbox for unit tests
authorTimo Tijhof <krinklemail@gmail.com>
Wed, 5 Feb 2014 20:52:56 +0000 (12:52 -0800)
committerKrinkle <krinklemail@gmail.com>
Tue, 11 Feb 2014 10:14:09 +0000 (10:14 +0000)
commitd4ded43a68fe8038f1178675e749d198f7ef2dea
tree5788792f5ca9648274b8bedce6743e75febd1a99
parent7884ef52f6d7f36418bbcefdf13daf437b408622
mediawiki.api.test: Use sinon sandbox for unit tests

Make the unit tests faster and more standalone:

* Don't make a request to the actual API, instead provide the
  response via the fake server and purely test the mw.Api interface.

* No need for promise aggregration since the process is now
  synchronous.

* No arbitrary delays for async or animations etc. as sinon
  artificially fast-forwards setTimeout, Date and others for us.

Also:

* Move assertion for API error handling to separate test.

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