title: Can not find jest in subpackage of yarn workspace
body: <p>I'm trying to refactor a Typescript project to monorepo with multiple packages (with yarn workspaces). In one of the packages (<code>packages/compiler</code>) I have jest installed, and have several tests. They worked before, but after refactoring I get the following error message:</p>
  <blockquote>
  <p>Cannot find name 'it'. Do you need to install type definitions for a</p>
  <p>test runner? Try <code>npm i @types/jest</code> or <code>npm i @types/mocha</code></p>
  </blockquote>
  <p>I can't seem to figure out how to get jest to work.</p>
  <p>I have jest installed &quot;locally&quot; in the package with all the tests. But if I check <code>node_modules/</code> after a <code>yarn install</code>, I can only see a <code>.bin</code> directory in <code>packages/compiler/node_modules</code>, and I can see (ts-)jest installed in the &quot;root&quot; <code>node_modules</code>. I think that I need to make sure that jest is installed in the node_modules of my packages (<code>packages/compiler/node_modules</code>) instead of in the root. But I can't seem to work out how to do that (the <code>nohoist</code> option in the root package.json doesn't work).</p>
  <p>So my question is how do I get jest to work in my subpackage?</p>
  <p>The root <code>package.json</code>:</p>
  <pre><code>{
    &quot;name&quot;: &quot;pannenkoekjs&quot;,
    &quot;private&quot;: true,
    &quot;workspaces&quot;: [
      &quot;packages/*&quot;
    ],
    &quot;devDependencies&quot;: {
      &quot;lerna&quot;: &quot;^3.18.4&quot;
    }
  }
  </code></pre>
  <p>The <code>package.json</code> in <code>packages/compiler</code>:</p>
  <pre><code>{
    &quot;name&quot;: &quot;@pannenkoekjs/compiler&quot;,
    &quot;dependencies&quot;: {
      &quot;typescript&quot;: &quot;^3.6.2&quot;
    },
    &quot;devDependencies&quot;: {
      &quot;@types/jest&quot;: &quot;^24.0.23&quot;,
      &quot;jest&quot;: &quot;^24.9.0&quot;,
      &quot;ts-jest&quot;: &quot;^24.1.0&quot;,
    }
  }
  </code></pre>
  <p>And the <code>jest.config.js</code> in <code>packages/compiler</code>:</p>
  <pre><code>module.exports = {
    preset: &quot;ts-jest&quot;,
    testEnvironment: &quot;node&quot;,
  };
  </code></pre>