<NME> index.js
<BEF> /* globals mocha */

export { loadTests } from './test-loader';

import describeModule       from 'ember-mocha/describe-module';
import describeComponent    from 'ember-mocha/describe-component';
import describeModel        from 'ember-mocha/describe-model';
import { it, afterEach } from 'mocha';
import { setResolver, resetOnerror } from '@ember/test-helpers';

/**
 * Instruct Mocha to start the tests.
 */
export function startTests() {
  mocha.run();
}

function setupResetOnerror() {
  afterEach(function() {
    resetOnerror();
  });
}

/**
 * @method start
 * @param {Object} [options] Options to be used for enabling/disabling behaviors
 * @param {Boolean} [options.loadTests] If `false` tests will not be loaded automatically.
 * @param {Boolean} [options.startTests] If `false` tests will not be automatically started
 * (you must run `startTests()` to kick them off).
 */
export function start(options = {}) {
  setupResetOnerror();

  if (options.loadTests !== false) {
    loadTests();
  }

  if (options.startTests !== false) {
  mocha.run();
}

export {
  describeModule,
  describeComponent,

<MSG> Extract `start()` function

<DFF> @@ -2,6 +2,7 @@
 
 export { loadTests } from './test-loader';
 
+import { loadTests } from './test-loader';
 import describeModule       from 'ember-mocha/describe-module';
 import describeComponent    from 'ember-mocha/describe-component';
 import describeModel        from 'ember-mocha/describe-model';
@@ -39,6 +40,24 @@ export function startTests() {
   mocha.run();
 }
 
+
+/**
+ * @method start
+ * @param {Object} [options] Options to be used for enabling/disabling behaviors
+ * @param {Boolean} [options.loadTests] If `false` tests will not be loaded automatically.
+ * @param {Boolean} [options.startTests] If `false` tests will not be automatically started
+ * (you must run `startTests()` to kick them off).
+ */
+export function start(options = {}) {
+  if (options.loadTests !== false) {
+    loadTests();
+  }
+
+  if (options.startTests !== false) {
+    startTests();
+  }
+}
+
 export {
   describeModule,
   describeComponent,

Extract `start()` function