I'm using this gist to read configuration file during application startup. This works fine but when doing unit tests I get error Cannot read property 'SomeProperty' of null.
I have added the provider to test as well
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoginComponent ],
imports: [ReactiveFormsModule, RouterTestingModule, HttpModule],
providers: [AuthService,
SettingsService,
AppConfig,
{
provide: APP_INITIALIZER,
useFactory: initConfig,
deps: [AppConfig],
multi: true
},
]
})
.compileComponents();
}));
Any pointers to resolve this?. Thanks in advance.
SomeProperty