Code coverage is not generated after quitting the app

Hi, I’m facing a similar issue, it’s not generating the coverage after I quit the fdk run

Hi Pablo,

Could you confirm your FDK version to check if I can reproduce the issue on my end?

Were you able to reproduce it with the “Your First App” template from the FDK or only for your app? If only your app, could you confirm what all the features are being used in the app and the steps followed by you to recheck the same steps at my end?

Hi Raviraj,

I’m using fdk version 8.6.7, even with the “Your First App” template it doesn’t work, check the image below:

Does it make any difference if it’s a freshchat or a freshdesk app?
Also, it’s a react app

I just noticed something, my app is a freshchat app, and the example I sent you of the “Your first app” is a freshdesk app, I just tried the “Your first app” for freshchat and it seems to work, I don’t know what could be different from mine.

This looks like an issue with React apps. Please give us some time to investigate this.

Similar report here:

I think I figured out what was wrong, my app uses .mjs extension, I changed to use .js and it seems to generate some coverage, I’ll run a few more tests today to see if the coverage is generated properly

check the file lib/routes/iframe.js:160

  if (req.method === 'GET') {
    if (req.path.endsWith('.js')) {
      debuglog(`Responding with contents of ${req.path}`);
      return res.send(coverageUtil.instrument(fullPath));
    }

    if (req.path.endsWith('.html')) {
      debuglog(`Responding with contents of ${req.path}`);
      return res.send(fs.readFileSync(fullPath, 'utf8') + WSS_SCRIPT);
    }
  }

So, I managed to run the coverage, although I can’t get it to 80% due to the js file contains react as well, and when I run fdk validate I’m getting this:

I believe this is because it’s also validating the entire React library, how can I proceed in this case?

Hi @pablobfonseca,

For the apps built with frontend frameworks, Freshworks CLI (FDK) cannot measure the code coverage yet since the actual code, and the compiled code varies.

We do not require 80% code coverage for the apps built with the frontend framework. Please follow the guidelines to attach the source within the app folder. The app will not be rejected for less than 80% code coverage.
Let us know if you still get stuck submitting the app to our Marketplace.

Hi Raviraj

Thank you for your response, I can’t even pack the extension due to the WARNS, is there another way I can submit the app?

Hi Pablo,

If there are no errors and only warnings, FDK should pack the app.

But I have sent you a workaround in the chat here to unblock you quickly. Please check and proceed.

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