mirror of
https://github.com/discourse/discourse.git
synced 2024-11-28 09:04:00 +08:00
210d13e3cb
This started out as a seemingly benign refactor to replace the `require` for `withPluginApi` to an actual import. However, it broke the test in seemingly random places. It turns out that in serveral places, we are calling `isTesting()` in module scope and assigning the result to a constant. For example we do that in the composer service to disable checking drafts when testing. This is problematic because `isTesting` doesn't really set until the `discourse-bootstrap` initializer is run, and so any modules that are evaluated before then will have locked in the wrong value for `isTesting()`. If we are going to use and treat `isTesting()` like a constant then we will have to make sure we set it sufficiently early before any code-loading happens. |
||
---|---|---|
.. | ||
assets | ||
controllers | ||
helpers | ||
jobs | ||
mailers | ||
models | ||
serializers | ||
services | ||
views |