I have a class like the one shown here:
import {otherStuff} from 'somewhere'
const promiseFtp = require('promise-ftp');
export class processor(){
ftp: any;
public async connect(){
ftp = new promiseFtp();
await ftp.connect(myConnectionObject);
this.ftp = ftp;
}
}
My problem is that I have no way to mock promiseFtp. I cant find any documentation in Jasmine that supports this sort of testing. I would let it just call the connect function, but I dont want it to actually connect to any ftp site.
I might be able to use something like proxyquire, but my boss is against it since we moved to typescript, and that was supposed to get rid of proxyquire. I cannot use proxyquire Typescript should have a way around this somehow.
I even tried to my my own module that exports promiseFtp, then mocks that module, but I just cant do it. How do you mock a class so that it wont get called.