mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 20:22:45 +08:00
DEV: Make dockcontainer
and hidepassed
the defaults (#12416)
This makes running qunit tests in a browser much simpler
This commit is contained in:
parent
fb19ee9eee
commit
37c42a57b0
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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 });
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user