discourse/app/assets/javascripts/wizard/test/helpers/start-app.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
426 B
JavaScript
Raw Normal View History

import { run } from "@ember/runloop";
2016-09-14 03:14:17 +08:00
import Wizard from "wizard/wizard";
import initializer from "wizard/initializers/load-helpers";
let app;
let started = false;
export default function() {
run(() => (app = Wizard.create({ rootElement: "#ember-testing" })));
2016-09-14 03:14:17 +08:00
if (!started) {
2016-11-26 03:29:24 +08:00
initializer.initialize(app);
2016-09-14 03:14:17 +08:00
app.start();
started = true;
}
app.setupForTesting();
app.injectTestHelpers();
return app;
}