<p dir="auto">There are a handful of tests in Angular's code base, but nothing that really does a good job giving non-Angular-core developers a way to test their components. See Angular Dart 1.0's <code class="notranslate">TestBed</code> for examples.</p>
<p dir="auto">Prerequisite: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="57397069" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/614" data-hovercard-type="issue" data-hovercard-url="/angular/angular/issues/614/hovercard" href="https://github.com/angular/angular/issues/614">#614</a>, <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="57240224" data-permission-text="Title is private" data-url="https://github.com/angular/angular/issues/596" data-hovercard-type="issue" data-hovercard-url="/angular/angular/issues/596/hovercard" href="https://github.com/angular/angular/issues/596">#596</a></p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="describe('MyComponent', () =&gt; {
  it('should instantiate', @Injectable (tb:Testbed) =&gt; {
    var element:Element = tb
      .directive(MyDirective, { override: [new Template(...), new Component(...)] })
      .compile({
        html: '&lt;my-component a=&quot;b&quot; [c]=&quot;exp&quot;&gt;lightdom&lt;/my-component&gt;')
      .instantiate({some instance or Type})
      .element;
    });
  });
});

@Component({
  selector: 'my-component'
})
class MyComponent{}"><pre class="notranslate"><code class="notranslate">describe('MyComponent', () =&gt; {
  it('should instantiate', @Injectable (tb:Testbed) =&gt; {
    var element:Element = tb
      .directive(MyDirective, { override: [new Template(...), new Component(...)] })
      .compile({
        html: '&lt;my-component a="b" [c]="exp"&gt;lightdom&lt;/my-component&gt;')
      .instantiate({some instance or Type})
      .element;
    });
  });
});

@Component({
  selector: 'my-component'
})
class MyComponent{}
</code></pre></div>