DEV: Make dockcontainer and hidepassed the defaults (#12416)

This makes running qunit tests in a browser much simpler
This commit is contained in:
Robin Ward 2021-03-16 14:34:59 -04:00 committed by GitHub
parent fb19ee9eee
commit 37c42a57b0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 1 deletions

View File

@ -30,6 +30,9 @@ module.exports = function (defaults) {
let app = new EmberApp(defaults, {
autoRun: false,
"ember-qunit": {
insertContentForTestBody: false,
},
});
// WARNING: We should only import scripts here if they are not in NPM.

View File

@ -81,6 +81,13 @@ function createApplication(config, settings) {
}
function setupTestsCommon(application, container, config) {
QUnit.config.hidepassed = true;
// Let's customize QUnit options a bit
QUnit.config.urlConfig = QUnit.config.urlConfig.filter(
(c) => ["dockcontainer", "nocontainer"].indexOf(c.id) === -1
);
application.rootElement = "#ember-testing";
application.setupForTesting();
application.injectTestHelpers();

View File

@ -8,6 +8,15 @@ document.addEventListener("discourse-booted", () => {
let setupTests = require("discourse/tests/setup-tests").default;
Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = false;
document.write(`
<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();
start({ setupTestContainer: false });
});