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