Hi,
first of all, thank you for the implementation of mocks for interfaces in version 2.4.
I see that in v2.4, declaration of mock has changed from
export declare function mock<T>(clazz: {
new (...args: any[]): T;
} | (Function & {
prototype: T;
})): T;
to
export declare function mock<T>(clazz?: any): T;
That means the code below is not now correct because the compiler does not know anymore the type of the mock object.
let a = mock(MyClazz)
a.myFunction()
If this changed was done to support interfaces, maybe it makes sense to have 2 different methods? One for mocking classes and one for interfaces? Otherwise, I think at least the change should be documented in the release notes
Hi, first of all, thank you for the implementation of mocks for interfaces in version 2.4.
I see that in v2.4, declaration of mock has changed from
to
That means the code below is not now correct because the compiler does not know anymore the type of the mock object.
If this changed was done to support interfaces, maybe it makes sense to have 2 different methods? One for mocking classes and one for interfaces? Otherwise, I think at least the change should be documented in the release notes
thanks!