How to get coverage over 80%

Hi Folks,

We are building a marketplace app, we are in the final stage of publishing the app to the marketplace. But we are unable to get coverage over 80%. We found few files where we are unable to get past 30%.

The files are separate modals, each modal consists of 2-3 flow, so all of the code won’t be executed on one flow. So we tried all the flows separately in all the modals, but every time we execute one flow, the previous flows coverage is getting lost.

So what we think is, whenever the modal is getting opened it is coming to the call stack and destroyed on modal close. So the coverage is being reset whenever the modal is opened.

In this case, how do we achieve 80% of coverage?

Thanks,
Arshath

1 Like

Hi @arshath.h,

Could you show us the coverage report and the test coverage for those mentioned modals?
Also, the code snippet for those modals which cannot be covered without being reset will be able to help us understand the issue better.

[Please hide/remove any sensitive information for the account and business logic]

Hi @Raviraj,

I have shared the file in DM. Please let me know if you need further details.

Just comment out app initialization error functions. Because its as per my knowledge its difficult to simulate initialization errors.

We have documented more on Code coverage and how it can be improved in this Wiki article.

We couldn’t get to a conclusion.

Freshworks CLI (FDK) lazily writes the code coverage which could take time to stay within the page context to get the code coverage for an execution. If the modal is closed by the code and the specific scope is not covered, your guess could be the reason.

If anyone else faces a similar issue, please report it in this thread so that we could try reproducing it to fix it for you. If possible, try to get that uncovered code within the 20% buffer for the app submission requirement or get it touch with our team via the dev-assist portal.

This topic was automatically closed 6 days after the last reply. New replies are no longer allowed.