-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
Currently, it seems we cannot mock an object method. An attempt to write something like
mock(myObj.tryGet, (): null | Something => fakeReturn)
will result in an error:
ERROR TS2322: Type '(this: MyClass) => Something | null' is not assignable to type '() => Something | null'.
Of course, adding a parameter for the this
in the lambda will not work and produce
ERROR TS2322: Type '(this: MyClass) => Something | null' is not assignable to type '(MyClass) => Something | null'.
Is it technically possible to add mocks of object methods to the framework?
Otherwise OOP is either prohibited or not testable in AS when using this framework.
Metadata
Metadata
Assignees
Labels
No labels