Bird
0
0

Your Cypress coverage report remains empty after adding the code coverage plugin. Which action is most likely to fix this?

medium📝 Debug Q6 of 15
Cypress - Plugins and Ecosystem
Your Cypress coverage report remains empty after adding the code coverage plugin. Which action is most likely to fix this?
ADisable source maps in the build configuration
BIncrease the timeout for Cypress tests
CAdd <code>import '@cypress/code-coverage/support'</code> to the support file and register the task in plugins
DRun tests with the <code>--no-exit</code> flag
Step-by-Step Solution
Solution:
  1. Step 1: Verify plugin setup

    The plugin requires both support file import and plugin task registration to collect coverage.
  2. Step 2: Apply missing configuration

    Adding import '@cypress/code-coverage/support' in support and registering the task in cypress/plugins/index.js enables coverage collection.
  3. Final Answer:

    Add import '@cypress/code-coverage/support' to the support file and register the task in plugins -> Option C
  4. Quick Check:

    Both support import and plugin task are required [OK]
Quick Trick: Ensure both support import and plugin task are configured [OK]
Common Mistakes:
  • Only importing support without plugin task registration
  • Ignoring plugin setup steps
  • Changing unrelated test settings

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Cypress Quizzes