mediawiki.hook: Move mw.hook tests to new mediawiki.base.test.js file
authorTimo Tijhof <krinklemail@gmail.com>
Fri, 22 Jun 2018 18:56:00 +0000 (19:56 +0100)
committerNikerabbit <niklas.laxstrom@gmail.com>
Sat, 23 Jun 2018 07:57:27 +0000 (07:57 +0000)
commit75cc8d3e0003318cf8a8fb33cb98523f63abcfb9
tree5da7668fa06f0d00af40e96bfebd085c3054933f
parentf25d33057d248af1782be63714add0d2e9a421d2
mediawiki.hook: Move mw.hook tests to new mediawiki.base.test.js file

Follows-up 3801e54c29a.

Also:

* Split the test into smaller more dedicated tests.
* Make minor changes so as to only assert values in the tests'
  outer scope. Assertions within callbacks are an anti-pattern
  that is fragile and can easily miss or mask problems. Using a
  single state observer that is modified by the callbacks makes
  for strict assertions with no implied or untested behaviour.
  Callbacks running in a different order or a different number of
  times now cause assertion failures - instead of causing the
  assertion to not be run, or to be run multiple times, which
  would pass.

Bug: T192623
Change-Id: Ice1560b754f8df29ca583eea19f559020fafaf12
tests/qunit/QUnitTestResources.php
tests/qunit/suites/resources/mediawiki/mediawiki.base.test.js [new file with mode: 0644]
tests/qunit/suites/resources/mediawiki/mediawiki.test.js