Spying on abstract method (Sinon + TS)

13 Views Asked by At

Given the following class, how can I spy on the abstract method f and make sure it is being called in other implemented methods (g)? I'm using Sinon + TypeScript. Using sinon.stub or sinon.spy does not work because the class does not really have a member of that name.

class MyClass {
   abstract f(): number;
   g(): void {
     //some logic
     f();
   }
}
0

There are 0 best solutions below