I am trying to test my component that has a constructor that introduced the AzureService service
Here is a component snippet:
constructor(private azureService: AzureService) { }
Here is the specified file:
beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [ DashbaordComponent, StatusComponent ], providers:[ AzureService] }).compileComponents(); })); it('should create the app', async(() => { const fixture = TestBed.createComponent(DashbaordComponent); const app = fixture.debugElement.componentInstance; expect(app).toBeTruthy(); }));
Here is the service:
export declare var WindowsAzure; @Injectable() export class AzureService { constructor() { this.client = new WindowsAzure.MobileServiceClient(this.azureUrl); } }
I canโt understand why this is not important. Azure-Apps-Client library imported into index.html file:
<script src="//zumo.blob.core.windows.net/sdk/azure-mobile-apps-client.2.0.0.js"></script>
Is there any way to load this library before running the test?
Anyone lead to this?
UPDATE: Here is the reason the test failed: 
UPDATE: Here is the component code:
getModules() { this.result.updateInfo("Getting classes...") this.azureService.getProgrammesByWrapper().then(((res) => { this.result.updateInfo("Sorting classes...") this.displayModules(res); this.result.updateSuccess(true); })); }
source share