DEV: Support qunit_disable_auto_start in ember CLI (#16358)

Required for e.g. `test/run-qunit.js`
This commit is contained in:
Jarek Radosz 2022-04-02 21:15:50 +02:00 committed by GitHub
parent 9060a045c2
commit 6555f0c11b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions

View File

@ -16,8 +16,10 @@ document.addEventListener("discourse-booted", () => {
} }
let setupTests = require("discourse/tests/setup-tests").default; let setupTests = require("discourse/tests/setup-tests").default;
const skippingCore = const params = new URLSearchParams(window.location.search);
new URLSearchParams(window.location.search).get("qunit_skip_core") === "1"; const skipCore = params.get("qunit_skip_core") === "1";
const disableAutoStart = params.get("qunit_disable_auto_start") === "1";
// eslint-disable-next-line no-undef // eslint-disable-next-line no-undef
Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = false; Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = false;
@ -43,10 +45,12 @@ document.addEventListener("discourse-booted", () => {
} }
loader.loadModules(); loader.loadModules();
start({ start({
setupTestContainer: false, setupTestContainer: false,
loadTests: false, loadTests: false,
setupEmberOnerrorValidation: !skippingCore, startTests: !disableAutoStart,
setupEmberOnerrorValidation: !skipCore,
}); });
}); });
window.EmberENV.TESTS_FILE_LOADED = true; window.EmberENV.TESTS_FILE_LOADED = true;