This how a example looks like:
export class ABC {
constructor() {
this.method1();
}
method1() {
console.log();
}
}
Assume that there are some calls to external methods in method1 which are stopping the code to go forward. I don't want to go inside the method1.
Now the problem is when I do this:
describe('test cases!', () => {
let abc: ABC;
beforeEach(() => {
spyOn(abc, 'method1').and.stub();
abc = new ABC();
jest.resetAllMocks();
});
});
It's throwing error.
After the class initialisation I can't put the spyOn.
Any idea guys?
Thanks for help.