Skip to content

Code coverage with "all" option does not report uncovered source code #17

Description

@xiamingwei

System info

● Playwright Version: [v1.31.2]
● Operating System: [macOS 12.0.1 MacBook Pro M1.]
● Browser: [Chromium]
● Other info: i am using the official recommended code coverage instrumentation library, playwright-test-coverage you can see it in (microsoft/playwright#7030)

Source code
(https://github.com/xiamingwei/umi-e2e-test/blob/main/e2e/index.spec.ts)
I will provide a minimal repository to reproduce this issue

Steps
tnpm i
tnpm run e2e
npx nyc --all report --reporter=html --reporter=json-summary --reporter=json

Expected
in the index.html file located in the generated coverage folder,All files in the application should be displayed, but only the files covered by the test cases are shown. because i also have other modules like Home.tsx,Detail.tsx etc...
image
image
Actual

image
In fact, only the files mentioned in the test cases are displayed,this will cause a phenomenon that when I add test cases for other pages, the new test cases will also be included in the coverage report, leading to a decrease in the original coverage rate.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions