Coverage not registering for typescript


I’ve built an app for my company using typescript and want to publish it, but I cannot get coverage over 80%. Although my functions are called they are not registered in coverage report, which I tested by adding simple console.log("hello") at the end of function. When I run the app I use the function and everything works fine hello is also displayed in console, but in coverage report the function shows as not called:

This kind of behavior happens for many of the functions. What would you suggest to fix this?


1 Like

Hi @Peteris_Kuskis ,

Welcome to the Developer Community :tada:

We had used the typescript sample app marketplace-sample-apps/Freshworks-Samples/Freshchat/freshchat-typescript-app at master · freshworks/marketplace-sample-apps · GitHub and are unable to reproduce the issue. Can you check with the sample app and let us know if you are facing similar issue.

1 Like

Thanks for the replay.

In the end the problem was not connected to typescript, but how validator validates promise function chains that end with client.instane.close() as while chain was written correctly and all sequence was waiting for previous promise resolution, if I did not add setTimeout() to client.instance.close() with ~50ms delay. Validator did not show code as being executed.

1 Like