title: How to provide/mock Angularfirestore module inside angular component for default test to pass?
body: <p>How can I provide AngularFirestore module inside my app.component so that my default <code>toBeTruthy()</code> test will pass?</p>
  
  <pre><code>Error: StaticInjectorError(DynamicTestModule)[AppComponent -&gt; AngularFirestore]: 
        StaticInjectorError(Platform: core)[AppComponent -&gt; AngularFirestore]: 
          NullInjectorError: No provider for AngularFirestore!
  </code></pre>
  
  <p><strong>app.component</strong></p>
  
  <pre><code>export class AppComponent implements OnInit {
    private notesCollection: AngularFirestoreCollection&lt;any&gt;;
    public notes: Observable&lt;any[]&gt;;
  
    constructor(private afs: AngularFirestore) {}
  
    ngOnInit() {
      this.notesCollection = this.afs.collection('notes');
      this.notes = this.notesCollection.valueChanges();
    }
  }
  </code></pre>
  
  <p>it's just the default test:</p>
  
  <pre><code>class FirebaseMock implements AngularFirestore {
    app: FirebaseApp;
    firestore: FirebaseFirestore;
    persistenceEnabled$: Observable&lt;boolean&gt;;
  
    collection&lt;T&gt;(path: string, queryFn?: QueryFn): AngularFirestoreCollection&lt;T&gt; {
      return undefined;
    }
  
    doc&lt;T&gt;(path: string): AngularFirestoreDocument&lt;T&gt; {
      return undefined;
    }
  
    createId(): string {
      return undefined;
    }
  }
  
  describe('AppComponent', () =&gt; {
    let component: AppComponent;
    let fixture: ComponentFixture&lt;AppComponent&gt;;
  
    beforeEach(
      async(() =&gt; {
        TestBed.configureTestingModule({
          imports: [
            RouterTestingModule,
  
          ],
          declarations: [ AppComponent ],
          providers: [
            {
              provide: AngularFirestoreModule,
              useClass: FirebaseMock
            },
          ],
        }).compileComponents();
      }),
    );
  
    beforeEach(() =&gt; {
      fixture = TestBed.createComponent(AppComponent);
      component = fixture.componentInstance;
      fixture.detectChanges();
    });
  
    it('should create', () =&gt; {
      expect(component).toBeTruthy();
    });
  });
  </code></pre>