We have a legacy Angular 4 project using SystemJS. We have been asked to implement unit test cases using Jasmine and Karma. I started writing a test suite for one component. It looks something like this (pseudo code below):
beforeEach(async(() => {
TestBed.configureTestingModule(
imports,
providers,
declarations etc.
).compileComponents();
}));
We have a lot of initialization code in an APP_INITIALIZER, that sets up various pieces of state in the application (such as Reference data, configuration, user information). For the test cases to run smoothly, we need the Initialization code to run. Any idea how this can be achieved?