mediawiki.loader: Clean up unit tests
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 13 Apr 2018 00:49:43 +0000 (01:49 +0100)
committerTimo Tijhof <krinklemail@gmail.com>
Fri, 13 Apr 2018 00:49:43 +0000 (01:49 +0100)
commitf03d3a7a169dfad421616a461bd21e80a3d909fe
tree7aa561b1eca5a7f5aaa3f59f1b95fee4fcbb2190
parent2121cca716e8454e73c45e81c8a42dd7d05f66eb
mediawiki.loader: Clean up unit tests

* Avoid parenthesis in module name to make it easier to remember
  and type. Use "mediawiki.loader", which matches the naming for
  other mediawiki.js tests (e.g, 'mediawiki.html').

* Simplify teardown: Remove redundant check before deletion.
  The delete operator already performs this check and varies it
  returns value based on it (which we aren't using here).

* Remove 'Basic', which did the same as 'using() Promise'.

* Add test for 'using(, callback)' parameter.

* Simplify "did the script run" assertions by checking once
  afterwards, instead of checking both during the test and afterwards.
  The one during the test isn't a strict assertion, given it could
  be skipped. To preserve the detection of whether it ran twice,
  use a counter.

* Remove various redundant 'fail' assertions from Promise fail
  handlers in tests that were already returning said Promise,
  given QUnit already checks if the Promise is rejected.

* Simplify a few assert captions.

* Make assertion for 'messages load first' its own test,
  instead of happening in an unrelated test about @import CSS.

Change-Id: Icbb4ea7f16bb1f702fd92eb8007b7179d4763151
tests/qunit/suites/resources/mediawiki/mediawiki.loader.test.js