Middleware testing Issue impacting code coverage

In our app.js file, we are currently able to execute only 92 out of 200 branches , leaving us below 50% branch coverage . We are unable to execute certain branches because specific if-else conditions depend on a middleware request.

During local testing, we are unable to establish a connection with the middleware endpoint, which causes the request to throw an error. As a result, the middleware function returns false, triggering only the error notification. This prevents the success-related functions, which depend on a true response from the middleware, from executing. Since 5 to 6 functions rely on the middleware request returning true, we are unable to cover those branches and improve our overall code coverage

Hi @Tamilarasi

Greetings!

Freshworks recommends and enforces a minimum coverage of 80 or more for marketplace applications.

If you are managing the server, we would recommend adjusting the cases to meet the recommended coverage.

If it is a third-party server, you can raise your concern with the marketplace team to resolve this issue. I’m sure they will understand the situation and assist you accordingly.

Thank you.

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