From 3e8d3494651c50751ec248506a9e4a13137e5c6b Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 10 Mar 2023 12:40:59 +0000 Subject: [PATCH] DEV: Correct core test run detection for theme-qunit (#20635) Followup to 8f1a5c93929465daa89dca8cebd972475b6181d3 --- app/assets/javascripts/discourse/tests/setup-tests.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/tests/setup-tests.js b/app/assets/javascripts/discourse/tests/setup-tests.js index 9125bed3585..78bdbf47c0b 100644 --- a/app/assets/javascripts/discourse/tests/setup-tests.js +++ b/app/assets/javascripts/discourse/tests/setup-tests.js @@ -388,11 +388,10 @@ export default function setupTests(config) { reportMemoryUsageAfterTests(); patchFailedAssertion(); - const hasPluginJs = Array.from( - document.querySelector("#dynamic-test-js").content.childNodes - ).some((script) => script.dataset?.discoursePlugin); + const hasPluginJs = !!document.querySelector("script[data-discourse-plugin]"); + const hasThemeJs = !!document.querySelector("script[data-theme-id]"); - if (skipPlugins || !hasPluginJs) { + if (!hasPluginJs && !hasThemeJs) { configureRaiseOnDeprecation(); } }