Faking a module in angular 2 test
问题 I have a function in angular 2 service which I would like to test. service.ts upload(){ let file = new Transfer(); file.upload(myfile).then( // my callback ); } I would like to mock Transfer in my test using jasmine . I tried this in my sevice.spec.ts import { TransferMock as Transfer } from '../mocks/mocks' to mock it. But it is not working. This is how my test is instantiated . describe('authentication service' , () => { beforeEach(() => { auth = new Service(<any>new HttpMock(), <any>new