method
doSmth(event: EventDescriptor<T>): (data: Data<T>) => boolean {
...
}
Is there any way to mock such methods using Jasmine?
Yeah, sure. Word you're looking for is "spying". More here and here depending what exactly you want to mock (property answer or just whole method)
But in short, basic spy for your example for boolean would be:
it('should return true when called with valid data', () => {
const mockEvent: EventDescriptor<string> = { ... };
const mockDoSmth = jasmine.createSpy().and.returnValue((data: Data<string>) => true);
const result = mockDoSmth(mockEvent)({ ... });
expect(result).toBe(true);
});