title: Unit tests for firebase add using angular 2
body: <p>Does anyone know how to do a basic unit test using angular 2 to test a basic firebase add item.</p>
  
  <p>I'm using typescript instead of basic JavaScript for my code</p>
  
  <p><strong>This is what I'm testing:</strong></p>
  
  <pre><code> export class AppComponent {
       ref: Firebase;
       refUsers: Firebase;
       refProfiles: Firebase;
  
       constructor(){
           this.ref = new Firebase("https://markng2.firebaseio.com");
           this.refUsers = new Firebase("https://markng2.firebaseio.com/users");
           this.refProfiles = new Firebase("https://markng2.firebaseio.com/profiles");    
       }
  
       public addUser(newUser: Object): void{     
           this.refUsers.push(newUser, ()=&gt;{
  
           });
       }
   }
  </code></pre>
  
  <p><strong>This is my current test:</strong></p>
  
  <pre><code> import {it, iit, describe, expect, inject, injectAsync, beforeEachProviders, fakeAsync, tick } from 'angular2/testing';
   import { AppComponent } from '../app/app';
  
   describe('AppComponent', () =&gt; {
  
       it('saves an item to Firebase', () =&gt; {
           let refUsers = new Firebase('');
  
           let service = new AppComponent();
  
           spyOn(service.refUsers, 'push');
           service.addUser({ item: true });
  
           expect(service.refUsers.push).toHaveBeenCalled();
       })
  
   });
  </code></pre>
  
  <p><strong>This is the error I'm getting when I run that test:</strong></p>
  
  <p><a href="https://i.stack.imgur.com/Velft.png" rel="noreferrer"><img src="https://i.stack.imgur.com/Velft.png" alt="enter image description here"></a></p>