I have this class I need to mock, the method is giving me problems - how do I set up findThing<T>()?
export interface ISomething { aValue: string; }
export class SomeClass implements ISomething { aValue: string; }
// These classes are unimportant, the method mock is the goal...
export class ParentClass {
private _obj = new SomeClass();
findThing<T>(): Observable<T> {
return of(this._obj as unknown as T);
}
}
I have this class I need to mock, the method is giving me problems - how do I set up
findThing<T>()
?Here's the code I tried:
I get this response:
TypeError: theMockInstance.findThing is not a function
If someone can confirm this is a problem/bug/missing feature that would be helpful.