title: Angular APP_INITIALIZER to load config file in tests
body: <p>I'm using this <a href="https://gist.github.com/fernandohu/122e88c3bcd210bbe41c608c36306db9" rel="noreferrer">gist</a> to read configuration file during application startup. This works fine but when doing unit tests I get error <code>Cannot read property 'SomeProperty' of null</code>.</p>
  
  <p>I have added the provider to test as well</p>
  
  <pre><code>beforeEach(async(() =&gt; {
      TestBed.configureTestingModule({
        declarations: [ LoginComponent ],
        imports: [ReactiveFormsModule, RouterTestingModule, HttpModule],
        providers: [AuthService,
          SettingsService,
          AppConfig,
          {
              provide: APP_INITIALIZER,
              useFactory: initConfig,
              deps: [AppConfig],
              multi: true
          },
          ]
      })
      .compileComponents();
    }));
  </code></pre>
  
  <p>Any pointers to resolve this?. Thanks in advance.</p>