mirror of
https://github.com/discourse/discourse.git
synced 2025-04-27 22:24:36 +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, {
|
let app = new EmberApp(defaults, {
|
||||||
autoRun: false,
|
autoRun: false,
|
||||||
|
"ember-qunit": {
|
||||||
|
insertContentForTestBody: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// WARNING: We should only import scripts here if they are not in NPM.
|
// 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) {
|
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.rootElement = "#ember-testing";
|
||||||
application.setupForTesting();
|
application.setupForTesting();
|
||||||
application.injectTestHelpers();
|
application.injectTestHelpers();
|
||||||
|
@ -8,6 +8,15 @@ document.addEventListener("discourse-booted", () => {
|
|||||||
let setupTests = require("discourse/tests/setup-tests").default;
|
let setupTests = require("discourse/tests/setup-tests").default;
|
||||||
Ember.ENV.LOG_STACKTRACE_ON_DEPRECATION = false;
|
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);
|
setupTests(config.APP);
|
||||||
start();
|
start({ setupTestContainer: false });
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user