Uncovered lines not shown for conditions in jsx

  • Version used: Sonarcloud
  • Error observed: No red mark for missing coverage on conditions in React JSX
  • Steps to reproduce: Add a javascript file containing JSX with a condition (e.g. {someCondition && (<div>test</div>)})
  • Potential workaround: Show red mark for uncovered line numbers in lcov report.

Hello Samuel,

Thank you for your message.

Unfortunately, I was not able to reproduce the problem you are facing. Analysing a JavaScript file just containing the code snippet you provided does show red mark for uncovered line numbers.

I suspect a parsing failure, but I would need the full logs to confirm it. Also, would it be possible to share a small reproducer that actually highlights missing red marks for that code pattern?

Yassin