<p dir="auto">Currently the common directives (CORE_DIRECTIVES and FORM_DIRECTIVES) are included automatically and do not need to be manually referenced in a component's <a class="user-mention notranslate" data-hovercard-type="organization" data-hovercard-url="/orgs/view/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/view">@view</a> annotation. However this is not the case for the TestComponentBuilder, which fails to build the component if the component uses unreferenced common directives. An example error message is:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="{&quot;message&quot;:&quot;Template parse errors: Can't bind to 'ngFormControl' since it isn't a known native property..."><pre class="notranslate"><code class="notranslate">{"message":"Template parse errors: Can't bind to 'ngFormControl' since it isn't a known native property...
</code></pre></div>
<p dir="auto">It's possible to add these references in to the component definition, but ideally the TCB should be able to build whatever Angular builds normally. Also the way the TCB handles errors (calling the onrejected callback of the promise, which I seldom see anyone binding to) means that tests can be regarded as passing if the component fails to build:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="tcb.createAsync(testComponent).then((fixture: ComponentFixture) =&gt; {
    expect(true).toBe(false)
})"><pre class="notranslate"><code class="notranslate">tcb.createAsync(testComponent).then((fixture: ComponentFixture) =&gt; {
    expect(true).toBe(false)
})
</code></pre></div>
<p dir="auto">Will pass if the TCB fails to create the component.</p>
<p dir="auto">So proposed solution would be to make the common directives available to the TCB.</p>
<p dir="auto">Spotted by <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/teropa/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/teropa">@teropa</a> and confirmed on my side in the ng2 directives for Bootstrap project (see: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="118373937" data-permission-text="Title is private" data-url="https://github.com/ng-bootstrap/ng-bootstrap/issues/115" data-hovercard-type="pull_request" data-hovercard-url="/ng-bootstrap/ng-bootstrap/pull/115/hovercard" href="https://github.com/ng-bootstrap/ng-bootstrap/pull/115">ng-bootstrap/ng-bootstrap#115</a>):</p>
<blockquote>
<p dir="auto">I'm getting errors about platform directives like ng-for when using TestComponentBuilder. Seems like they're not "ambient" in the unit tests like they are during normal execution.  I can fix it by including CORE_DIRECTIVES in the component, but that seems backward. Any ideas how to make them available?</p>
</blockquote>