DEV: Skip Ember OnError validation for plugin qunit tests (#15314)

If the Ember OnError validation test is added, it breaks the "no tests were run" detection (since at least 1 test is always run). This is particularly important when running tests scoped to a single plugin, because there is no indication that you have typo'd the `qunit_single_plugin` query parameter.
This commit is contained in:
David Taylor 2021-12-15 10:59:38 +00:00 committed by GitHub
parent 77781f9a11
commit 88fa8b5848
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,8 @@ setEnvironment("testing");
document.addEventListener("discourse-booted", () => {
let setupTests = require("discourse/tests/setup-tests").default;
const skippingCore =
new URLSearchParams(window.location.search).get("qunit_skip_core") === "1";
Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = false;
document.body.insertAdjacentHTML(
@ -26,5 +28,9 @@ document.addEventListener("discourse-booted", () => {
setupTests(config.APP);
let loader = loadEmberExam();
loader.loadModules();
start({ setupTestContainer: false, loadTests: false });
start({
setupTestContainer: false,
loadTests: false,
setupEmberOnerrorValidation: !skippingCore,
});
});