diff --git a/test-app/tests/helpers/destroy-app.js b/test-app/tests/helpers/destroy-app.js deleted file mode 100644 index e7f983bd1..000000000 --- a/test-app/tests/helpers/destroy-app.js +++ /dev/null @@ -1,5 +0,0 @@ -import { run } from '@ember/runloop'; - -export default function destroyApp(application) { - run(application, 'destroy'); -} diff --git a/test-app/tests/helpers/module-for-acceptance.js b/test-app/tests/helpers/module-for-acceptance.js deleted file mode 100644 index 4badde7b8..000000000 --- a/test-app/tests/helpers/module-for-acceptance.js +++ /dev/null @@ -1,45 +0,0 @@ -import { resolve } from 'rsvp'; -import { setTesting } from '@ember/debug'; -import { module } from 'qunit'; -import startApp from '../helpers/start-app'; -import destroyApp from '../helpers/destroy-app'; -import { setResolverRegistry } from './resolver'; -import QUnitTestAdapter from './qunit-test-adapter'; -import { setAdapter } from 'ember-testing/lib/setup_for_testing'; - -export default function (name, options = {}) { - module(name, { - beforeEach() { - setAdapter(QUnitTestAdapter.create()); - - if (options.registry) { - setResolverRegistry(options.registry); - } - - let testElementContainer = document.querySelector( - '#ember-testing-container' - ); - this.fixtureResetValue = testElementContainer.innerHTML; - - setTesting(true); - this.application = startApp(); - - if (options.beforeEach) { - return options.beforeEach.apply(this, arguments); - } - }, - - afterEach() { - let afterEach = - options.afterEach && options.afterEach.apply(this, arguments); - return resolve(afterEach) - .then(() => destroyApp(this.application)) - .finally(() => { - setTesting(false); - - document.getElementById('ember-testing-container').innerHTML = - this.fixtureResetValue; - }); - }, - }); -} diff --git a/test-app/tests/helpers/qunit-module-for.js b/test-app/tests/helpers/qunit-module-for.js deleted file mode 100644 index 4c0a0b641..000000000 --- a/test-app/tests/helpers/qunit-module-for.js +++ /dev/null @@ -1,33 +0,0 @@ -import { isTesting } from '@ember/debug'; -import { module } from 'qunit'; -import QUnitTestAdapter from './qunit-test-adapter'; -import { setAdapter } from 'ember-testing/lib/setup_for_testing'; - -export default function qunitModuleFor(testModule) { - module(testModule.name, { - beforeEach(assert) { - if (isTesting()) { - throw new Error('should not have isTesting() === true in beforeEach'); - } - setAdapter(QUnitTestAdapter.create()); - testModule.setContext(this); - return testModule.setup(assert).finally(() => { - if (!isTesting()) { - throw new Error( - 'should have isTesting() === true after tests have started' - ); - } - }); - }, - afterEach(assert) { - return testModule.teardown(assert).finally(() => { - setAdapter(null); - if (isTesting()) { - throw new Error( - 'should not have isTesting() === true after tests have finished' - ); - } - }); - }, - }); -} diff --git a/test-app/tests/helpers/qunit-test-adapter.js b/test-app/tests/helpers/qunit-test-adapter.js deleted file mode 100644 index f7b2dff4e..000000000 --- a/test-app/tests/helpers/qunit-test-adapter.js +++ /dev/null @@ -1,55 +0,0 @@ -import QUnit from 'qunit'; -import { Adapter } from '@ember/test'; - -/* - * This module is inlined here, because this library cannot depend on - * ember-qunit directly. The implementation in this test helper is nearly - * identical to the one used in `ember-qunit`. - */ - -function unhandledRejectionAssertion(current, error) { - let message, source; - - if (typeof error === 'object' && error !== null) { - message = error.message; - source = error.stack; - } else if (typeof error === 'string') { - message = error; - source = 'unknown source'; - } else { - message = 'unhandledRejection occurred, but it had no message'; - source = 'unknown source'; - } - - current.pushResult({ - result: false, - actual: false, - expected: true, - message: message, - source: source, - }); -} - -export default Adapter.extend({ - init() { - this.doneCallbacks = []; - }, - - asyncStart() { - this.doneCallbacks.push( - QUnit.config.current ? QUnit.config.current.assert.async() : null - ); - }, - - asyncEnd() { - let done = this.doneCallbacks.pop(); - // This can be null if asyncStart() was called outside of a test - if (done) { - done(); - } - }, - - exception(error) { - unhandledRejectionAssertion(QUnit.config.current, error); - }, -}); diff --git a/test-app/tests/helpers/start-app.js b/test-app/tests/helpers/start-app.js deleted file mode 100644 index cf6a7fee3..000000000 --- a/test-app/tests/helpers/start-app.js +++ /dev/null @@ -1,16 +0,0 @@ -import Application from '../../app'; -import config from '../../config/environment'; -import { run } from '@ember/runloop'; - -export default function startApp(attrs) { - let attributes = Object.assign({}, config.APP); - attributes.autoboot = true; - attributes = Object.assign(attributes, attrs); // use defaults, but you can override; - - return run(() => { - let application = Application.create(attributes); - application.setupForTesting(); - application.injectTestHelpers(); - return application; - }); -} diff --git a/test-app/tests/integration/.gitkeep b/test-app/tests/integration/.gitkeep deleted file mode 100644 index e69de29bb..000000000