diff --git a/blueprints/ember-cli-mocha/files/tests/helpers/destroy-app.js b/blueprints/ember-cli-mocha/files/tests/helpers/destroy-app.js new file mode 100644 index 0000000..e7f983b --- /dev/null +++ b/blueprints/ember-cli-mocha/files/tests/helpers/destroy-app.js @@ -0,0 +1,5 @@ +import { run } from '@ember/runloop'; + +export default function destroyApp(application) { + run(application, 'destroy'); +} diff --git a/blueprints/ember-cli-mocha/files/tests/helpers/start-app.js b/blueprints/ember-cli-mocha/files/tests/helpers/start-app.js new file mode 100644 index 0000000..99d35dc --- /dev/null +++ b/blueprints/ember-cli-mocha/files/tests/helpers/start-app.js @@ -0,0 +1,17 @@ +import Application from '../../app'; +import config from '../../config/environment'; +import { merge } from '@ember/polyfills'; +import { run } from '@ember/runloop'; + +export default function startApp(attrs) { + let attributes = merge({}, config.APP); + attributes.autoboot = true; + attributes = merge(attributes, attrs); // use defaults, but you can override; + + return run(() => { + let application = Application.create(attributes); + application.setupForTesting(); + application.injectTestHelpers(); + return application; + }); +}