title: How to import Javascript from from a Typescript unittest
body: <p>How do you run Typescript tests with Mocha for a NPM package that's mostly Javascript?</p>
  <p>I have some Javascript/Node.js code that I'm trying to write a unittest for. Since the code does processing on audio samples recorded through the browser, I need to test it by loading wav files from the local dev filesystem.</p>
  <p>Since that's a little easier to do in Typescript, I'd like to write my unittests in Typescript and Mocha.</p>
  <p>However, Mocha can't seem to find even a basic stub test.</p>
  <p>My package structure looks like:</p>
  <pre><code>src
      index.js
  test
      test.ts
      mocha.opts
  </code></pre>
  <p>Where test.ts looks like:</p>
  <pre><code>import MyPackage from '../src';
  
  describe('Simple Math Test', () =&gt; {
   it('should return 2', () =&gt; {
          assert.equal(1 + 1, 2);
      });
  });
  </code></pre>
  <p>And my mocha.opts looks like:</p>
  <pre><code>--require ts-node/register
  --recursive
  --reporter spec
  --ui bdd
  --timeout 20000
  test/**/*.ts
  </code></pre>
  <p>But when I run <code>mocha</code> from my project root, it outputs:</p>
  <pre><code>Error: No test files found
  </code></pre>
  <p>If I change my <code>test.ts</code> to <code>test.js</code>, then it finds it. How do I fix this?</p>
  <p>Edit: I found if I run the command <code>mocha -r ts-node/register test/test.ts</code>, then it seems to see the Typescript test.</p>
  <p>However, it still can't import my Javascript package:</p>
  <pre><code>Cannot find module '../src' or its corresponding type declarations.
  
  import MyPackage from '../src';
  </code></pre>