Skip to content

A platform for community discussion. Free, open, simple.

DEV: Make `theme-qunit` discoverable from `/tests` (#24606)

Isaac Janzenfeb5eda0d155
diff --git a/app/assets/javascripts/discourse/tests/setup-tests.js b/app/assets/javascripts/discourse/tests/setup-tests.js
index 41015f11e31..19f647e2c50 100644
--- a/app/assets/javascripts/discourse/tests/setup-tests.js
+++ b/app/assets/javascripts/discourse/tests/setup-tests.js
@@ -149,7 +149,14 @@ function setupToolbar() {
QUnit.config.urlConfig.push({
id: "target",
label: "Target",
- value: ["core", "plugins", "all", "-----", ...Array.from(pluginNames)],
+ value: [
+ "core",
+ "plugins",
+ "all",
+ "theme-qunit",
+ "-----",
+ ...Array.from(pluginNames),
+ ],
});
QUnit.begin(() => {
@@ -375,6 +382,9 @@ export default function setupTests(config) {
handleLegacyParameters();
const target = getUrlParameter("target") || "core";
+ if (target === "theme-qunit") {
+ window.location.href = window.location.origin + "/theme-qunit";
+ }
const hasPluginJs = !!document.querySelector("script[data-discourse-plugin]");
const hasThemeJs = !!document.querySelector("script[data-theme-id]");