This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/test-helper.js
Joffrey JAFFEUX 32d0467881
DEV: avoids using document.write (#13858)
It doesn’t provide much than just avoiding some logs in tests. I didn't change test_starter as it's going to be removed at some point.
2021-07-27 14:42:21 +02:00

25 lines
678 B
JavaScript

import config from "../config/environment";
import { setEnvironment } from "discourse-common/config/environment";
import { start } from "ember-qunit";
setEnvironment("testing");
document.addEventListener("discourse-booted", () => {
let setupTests = require("discourse/tests/setup-tests").default;
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>
`
);
setupTests(config.APP);
start({ setupTestContainer: false });
});