Skip to content

Support Code Coverage ReportingΒ #33

@shamrt-v

Description

@shamrt-v

Relevant code or config:

> nx run tools:test --coverage


 RUN  v1.6.1 /Users/smartin/code/workspaces/v/vantage/libs/tools
      Coverage enabled with v8

 βœ“ src/lib/utils/writeTiersFeatures.spec.ts (12) 1034ms
 βœ“ src/bin/tiers-features/addItem.spec.ts (9) 4412ms
 βœ“ src/bin/tiers-features/addFeatureToTier.spec.ts (4) 1344ms
 βœ“ src/lib/utils/getTiersFeatures.spec.ts (1)
 βœ“ src/bin/tiers-features/removeItem.spec.ts (2) 982ms
 βœ“ src/lib/utils/getNextPk.spec.ts (6)
 βœ“ src/lib/tools.spec.ts (1)

 Test Files  7 passed (7)
      Tests  35 passed (35)
   Start at  13:55:17
   Duration  8.50s (transform 89ms, setup 18ms, collect 356ms, tests 7.77s, environment 157ms, prepare 41ms)

 % Coverage report from v8
-------------------------|---------|----------|---------|---------|-------------------
File                     | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------------|---------|----------|---------|---------|-------------------
All files                |   35.63 |    80.43 |   53.33 |   35.63 |
 src                     |       0 |        0 |       0 |       0 |
  index.ts               |       0 |        0 |       0 |       0 | 1
 src/bin/tiers-features  |       0 |        0 |       0 |       0 |
  addFeatureToTier.ts    |       0 |        0 |       0 |       0 | 1-99
  addItem.ts             |       0 |        0 |       0 |       0 | 1-92
  manage.ts              |       0 |        0 |       0 |       0 | 1-42
  removeItem.ts          |       0 |        0 |       0 |       0 | 1-50
 src/lib                 |   91.66 |       50 |     100 |   91.66 |
  constants.ts           |   90.47 |    33.33 |     100 |   90.47 | 13-14
  tools.ts               |     100 |      100 |     100 |     100 |
 src/lib/utils           |   92.25 |    94.59 |      75 |   92.25 |
  getNextPk.ts           |     100 |      100 |     100 |     100 |
  getTiersFeatures.ts    |     100 |      100 |     100 |     100 |
  includesNameOrValue.ts |       0 |        0 |       0 |       0 | 1-2
  isUniqueKey.ts         |       0 |        0 |       0 |       0 | 1-10
  writeTiersFeatures.ts  |     100 |      100 |     100 |     100 |
-------------------------|---------|----------|---------|---------|-------------------

What you did:

Ran Vitest with --coverage flag (via Nx, which shouldn't affect reports), and do not see coverage for binary test modules (which thoroughly test a CLI wizard). Note that I'm using V8 as my coverage provider.

What happened:

Coverage reports are incomplete/non-existent for cli-testing-library spec modules.

Reproduction:

I'd expect any cli-testing-library code wouldn't provide coverage stats. I don't see anything in the source code that would handle this πŸ‘€

Problem description:

This is a gap in the tool, I'd say. Maybe I'm using the wrong tooling or coverage provider. Would istanbul work?

Suggested solution:

πŸ™‚ β€” perhaps this is a feature request

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions