title: angular cli : selectors unknown during tests
body: <p>I'm learning how to do my first tests with Angular 2, using <code>angular-cli</code>.</p>
  
  <p>When I create a new component <code>MyComponent</code>, then add its selector <code>app-mycomponent</code> into the app template, then all tests fail and say that <code>app-mycomponent</code> is unknown.</p>
  
  <p>This problem occurs only in tests; if I start the app then everything is fine.</p>
  
  <p>My environment:</p>
  
  <pre><code>npm : 3.10.10
  node : 6.9.5
  angular-cli : 1.0.0-beta.32.3
  jasmine-core: 2.5.2
  protractor: 5.1.0
  </code></pre>
  
  <p>Rather than copying tons of config files, here are steps to reproduce:</p>
  
  <ol>
  <li><p>create a new project</p>
  
  <pre><code>ng new testproj
  cd testproj
  </code></pre></li>
  <li><p>create a component</p>
  
  <pre><code>ng generate component mycomp
  </code></pre></li>
  <li><p>go to <code>./src/mycomp/mycomp.component.ts</code> and note its selector (should be <code>app-mycomp</code>)</p></li>
  <li><p>edit <code>./src/app/component.html</code> and add this line:</p>
  
  <pre><code>&lt;app-mycomp&gt;&lt;/app-mycomp&gt;
  </code></pre>
  
  <p>where <code>app-mycomp</code> is the selector you saw in step 3.</p></li>
  <li><p>launch the tests:</p>
  
  <pre><code>ng test
  </code></pre></li>
  </ol>
  
  <p>then here the failures reported : </p>
  
  <pre><code>Error: Template parse errors:
  'app-mycomp' is not a known element:
  1. If 'app-mycomp' is an Angular component, then verify that it is part of this module.
  2. If 'app-mycomp' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("
  {{title}}&lt;/h1&gt;
  [ERROR -&gt;]&lt;app-mycomp&gt;&lt;/app-mycomp&gt;"): AppComponent@3:0
  </code></pre>
  
  <p>Is it a bug, or have I done something wrong? I've tried manually setting <code>MyComponent</code> as a <code>provider</code> into <code>AppComponent</code>, same problem.</p>