From 6555f0c11bb04fb4a52b62d6cf62f4df82761cd6 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Sat, 2 Apr 2022 21:15:50 +0200 Subject: [PATCH] DEV: Support qunit_disable_auto_start in ember CLI (#16358) Required for e.g. `test/run-qunit.js` --- .../javascripts/discourse/tests/test-boot-ember-cli.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/tests/test-boot-ember-cli.js b/app/assets/javascripts/discourse/tests/test-boot-ember-cli.js index 2135f692d0e..4c347dd884d 100644 --- a/app/assets/javascripts/discourse/tests/test-boot-ember-cli.js +++ b/app/assets/javascripts/discourse/tests/test-boot-ember-cli.js @@ -16,8 +16,10 @@ document.addEventListener("discourse-booted", () => { } let setupTests = require("discourse/tests/setup-tests").default; - const skippingCore = - new URLSearchParams(window.location.search).get("qunit_skip_core") === "1"; + const params = new URLSearchParams(window.location.search); + const skipCore = params.get("qunit_skip_core") === "1"; + const disableAutoStart = params.get("qunit_disable_auto_start") === "1"; + // eslint-disable-next-line no-undef Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = false; @@ -43,10 +45,12 @@ document.addEventListener("discourse-booted", () => { } loader.loadModules(); + start({ setupTestContainer: false, loadTests: false, - setupEmberOnerrorValidation: !skippingCore, + startTests: !disableAutoStart, + setupEmberOnerrorValidation: !skipCore, }); }); window.EmberENV.TESTS_FILE_LOADED = true;