<p dir="auto"><code class="notranslate">createTestInjector</code> uses bindings that are missing <code class="notranslate">PLATFORM_DIRECTIVES</code>.</p>
<p dir="auto">This means that if a user defines a component that uses <code class="notranslate">NgIf</code> for example but doesn't specify an explicit dependency via <code class="notranslate">@Component({directives})</code>, it will work in the app but fail in tests.</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>