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.
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
import config from "../config/environment";
|
|
import { setEnvironment } from "discourse-common/config/environment";
|
|
import { start } from "ember-qunit";
|
|
import loadEmberExam from "ember-exam/test-support/load";
|
|
import * as QUnit from "qunit";
|
|
import { setup } from "qunit-dom";
|
|
|
|
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(
|
|
"afterbegin",
|
|
`
|
|
<div id="qunit"></div>
|
|
<div id="qunit-fixture"></div>
|
|
<div id="ember-testing-container" style="position: fixed">
|
|
<div id="ember-testing"></div>
|
|
</div>
|
|
`
|
|
);
|
|
|
|
setup(QUnit.assert);
|
|
setupTests(config.APP);
|
|
let loader = loadEmberExam();
|
|
loader.loadModules();
|
|
start({
|
|
setupTestContainer: false,
|
|
loadTests: false,
|
|
setupEmberOnerrorValidation: !skippingCore,
|
|
});
|
|
});
|