mirror of
https://github.com/discourse/discourse.git
synced 2025-02-11 22:04:58 +00:00
Previously we were adding `/assets/discourse/tests/core_plugin_tests.js` to the test html all the time. This works in development mode, but fails silently when using testem via the `ember test` CLI, because there is no proxy running. This commit makes a few changes to fix this, and make it more useful: - Only renders the plugin `<script>` when in development mode, or when `LOAD_PLUGINS=1` (matching core's behavior) - Only loads plugin translations based on the same logic - When running via testem, and the above conditions are met, testem is configured to proxy `core_plugin_tests.js` through to a rails server. (port based on the `UNICORN_PORT` env variable) - Adds a descriptive error if the plugin `<script>` fails to load. This can happen if the rails server hasn't been started - Updates the logic for testem browsers. Ember CLI always launches testem in "CI" mode, and we don't really want 3 browsers opening by default. Our CI explicitly specifies the 3 browsers at runtime