title: How to append a DOM element to an angular 2 TestBed?
body: <p>To cut to the chase, I would like to know if there is a way to prepend a DOM element to the test DOM. I'm new to testing but something like <code>fixture.degugElement.prepend('div')</code>. From what I've learned about testing this probably reveals a design flaw, so if you'd like some justification I have added the reason below.</p>
  
  <p><strong>Why I need to do this:</strong></p>
  
  <p>In my application I have a text ticker directive similar to <a href="https://github.com/NateMay/Angular2-text-ticker-directive" rel="nofollow noreferrer">this</a> previous version. In order to function I have to measure the length of the text. To achieve this I create a ghost element an stick it in my AppComponent</p>
  
  <pre><code>@Component({
    selector: 'app-root',
    template: `
      &lt;div id="ghost"&gt;&lt;/div&gt; &lt;!-- THIS IS THE GUY I NEED --&gt;
      &lt;div class="main-area"&gt;
        &lt;router-outlet&gt;&lt;/router-outlet&gt;
      &lt;/div&gt;
    `,
    styleUrls: ['./app.component.scss']
  })
  </code></pre>
  
  <p>Unfortunately I need this element to be where it is because of of the css positioning required to measure it properly, but that means that it is not available in my tests.</p>