import { createRunner } from 'atom-mocha-test-runner';

const testRunner = createRunner(
  {
    htmlTitle: `atom-languageclient Tests - pid ${process.pid}`,
    reporter: process.env.MOCHA_REPORTER || 'spec',
  },
  (mocha) => {
    mocha.timeout(parseInt(process.env.MOCHA_TIMEOUT || '5000', 10));
    if (process.env.APPVEYOR_API_URL) {
      mocha.reporter(require('mocha-appveyor-reporter'));
    }
  },
);

export = function runnerWrapper(options) {
  // Replace the test path with the current path since Atom's internal runner
  // picks the wrong one by default
  options.testPaths = [__dirname];
  return testRunner(options);
};

import { createRunner } from 'atom-mocha-test-runner';

module.exports = createRunner(
  {
    htmlTitle: `atom-languageclient Tests - pid ${process.pid}`,
    reporter: process.env.MOCHA_REPORTER || 'spec',
    colors: process.platform !== 'win32',
    overrideTestPaths: [/spec$/, /test/],
  },
  (mocha) => {
    mocha.timeout(parseInt(process.env.MOCHA_TIMEOUT || '5000', 10));
    if (process.env.APPVEYOR_API_URL) {
      mocha.reporter(require('mocha-appveyor-reporter'));
    }
  },
);

--- 
+++ 
@@ -1,11 +1,9 @@
 import { createRunner } from 'atom-mocha-test-runner';
 
-module.exports = createRunner(
+const testRunner = createRunner(
   {
     htmlTitle: `atom-languageclient Tests - pid ${process.pid}`,
     reporter: process.env.MOCHA_REPORTER || 'spec',
-    colors: process.platform !== 'win32',
-    overrideTestPaths: [/spec$/, /test/],
   },
   (mocha) => {
     mocha.timeout(parseInt(process.env.MOCHA_TIMEOUT || '5000', 10));
@@ -14,3 +12,10 @@
     }
   },
 );
+
+export = function runnerWrapper(options) {
+  // Replace the test path with the current path since Atom's internal runner
+  // picks the wrong one by default
+  options.testPaths = [__dirname];
+  return testRunner(options);
+};
Enable tests to run inside of Atom
