title: ngx-translate instant function is not a function thrown: Unit testing
body: <p>I'm fairly new for unit testing and Angular, and i'm trying to write some unit tests for my project.</p>
  
  <p>The error i'm getting is;</p>
  
  <pre><code>Uncaught TypeError: _this.translate.instant is not a function thrown
  Expected null to be truthy.
  </code></pre>
  
  <p>The imports of the component.spec file includes</p>
  
  <pre><code>beforeEach(async(() =&gt; {
  TestBed.configureTestingModule({
    imports:[
      ClarityModule,
      RouterTestingModule,
      TranslateModule.forRoot({
        loader: {
          provide: TranslateLoader,
          useFactory: (http: HttpClient) =&gt; new TranslateHttpLoader(http, 'assets/i18n/', '.json'),
          deps: [HttpClient]
        }
      }),
      HttpClientModule
    ],
    declarations: [
      HeaderComponent,
      LanguageSelectorComponent
    ],
    providers: [
      { provide: Store, useClass: TestStore },
      { provide: TranslateService, useClass: TranslateServiceStub },
      { provide: NGXLogger, useClass: NGXLoggerMock }
    ]
  })
  .compileComponents();
  }));
  </code></pre>
  
  <p>I understand that <code>TranslateServiceStub</code> does not include a 'instant' function. Is this the cause of this error? if so, how can i mock translate.instant function?</p>
  
  <p>Or is there any way to load the translations file in the spec file before instant method gets called?</p>
  
  <p>Any suggestion would be greatly helpful. Thanks a lot!</p>