While attempting to simulate a service, I included it in the providers array within the spec and utilized createSpyObj with its functions. However, I encountered the following error:
Access to XMLHttpRequest at ''ng://DynamicTestModule/mycomponent_Host.ngfactory.js' from origin 'http:localhost:9876'
Can anyone identify what mistake I may be making?
// .... import the service
mockService = jasmine.createSpyObj(['function1'])
testBed.configureTestingModule({
providers:[{
{provide: myService, useValue: mockService}
}]
}).compileComponents()