codex-lv4-may-2025

Level Navigation: 1 2 3 (4ℹ️) (5ℹ️) 6 7 8 9 10 11 12 13 14⚡ 15⚡ (16ℹ️) 17 18 19 20 21 22 23 24 25 26⚡ 27⚡ 28⚡ 29 30 31 32 33 34 35 36 37 38 39⚡ 40⚡

Level 36: Set Up Code Coverage

Configure code coverage reporting for your test suite. This helps you see which parts of your code are tested and which need more tests.

  1. Install coverage dependency (if not already installed): npm install -D @vitest/coverage-v8
  2. Add a coverage script to package.json
Show Me: coverage script setup

{
  "scripts": {
    "test": "vitest",
    "test:coverage": "vitest run --coverage"
  }
}
  1. Run npm run test:coverage to see your coverage report