{"id":39139818,"url":"https://github.com/parkuman/cypress-code-coverage-v8","last_synced_at":"2026-01-20T16:44:02.540Z","repository":{"id":274379016,"uuid":"921884562","full_name":"parkuman/cypress-code-coverage-v8","owner":"parkuman","description":"Saves the code coverage collected during Cypress tests using V8's native coverage tool","archived":false,"fork":false,"pushed_at":"2025-10-20T19:44:03.000Z","size":132,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T21:27:25.826Z","etag":null,"topics":["coverage","cypress","istanbul","javascript","nyc","v8"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cypress-code-coverage-v8","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/parkuman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-24T19:55:59.000Z","updated_at":"2025-10-20T19:44:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"d09c357f-1924-497f-be22-feb4724313c1","html_url":"https://github.com/parkuman/cypress-code-coverage-v8","commit_stats":null,"previous_names":["parkuman/cypress-code-coverage-v8"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/parkuman/cypress-code-coverage-v8","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkuman%2Fcypress-code-coverage-v8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkuman%2Fcypress-code-coverage-v8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkuman%2Fcypress-code-coverage-v8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkuman%2Fcypress-code-coverage-v8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/parkuman","download_url":"https://codeload.github.com/parkuman/cypress-code-coverage-v8/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/parkuman%2Fcypress-code-coverage-v8/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28518627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T18:55:29.170Z","status":"ssl_error","status_checked_at":"2026-01-17T18:55:03.375Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["coverage","cypress","istanbul","javascript","nyc","v8"],"created_at":"2026-01-17T21:29:47.419Z","updated_at":"2026-01-17T21:29:47.483Z","avatar_url":"https://github.com/parkuman.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cypress-code-coverage-v8\n\n\u003e Collects code coverage of your application under test using V8's built in\n\u003e JavaScript code coverage. No need to instrument your application!\n\n## Install\n\n```shell\nnpm install -D cypress-code-coverage-v8\n```\n\n**Note:** This plugin assumes that `cypress` is a peer dependency already installed in your project.\n\nThen add the code below to the `supportFile` and `setupNodeEvents` function.\n\n```js\n// cypress/support/e2e.{js|ts}\nimport \"cypress-code-coverage-v8/support\";\n```\n\n```js\n// cypress.config.{js|ts}\nimport { defineConfig } from \"cypress\";\nimport cypressV8Coverage from \"cypress-code-coverage-v8/task\";\n\nexport default defineConfig({\n  e2e: {\n    setupNodeEvents(on, config) {\n      cypressV8Coverage(on, config);\n      // include any other plugin code...\n\n      // It's IMPORTANT to return the config object here\n      return config;\n    },\n\n    baseUrl: \"http://localhost:5173/\",\n  },\n});\n```\n\nNext, run your Cypress tests with coverage enabled.\n**Note:** it must be run within Chrome.\n\n```shell\nCYPRESS_COVERAGE=true npx cypress run --browser chrome\n```\n\nThen you can generate the coverage report using `nyc`.\n\n```shell\nnpx nyc report --reporter=text --reporter=text-summary --reporter=html --temp-dir=cypress-coverage --report-dir=cypress-coverage-reports\n```\n\n## Examples\n\nCheck out the examples in the `test-apps` directory to see how this might work for your type of application.\n\n## V8 Coverage vs Istanbul?\n\nThere are some [trade-offs](https://github.com/jestjs/jest/issues/11188) associated with taking Coverage using V8's native system vs Istanbul. Please give the above a read and make your own decision on whether or not it is worth it for you.\n\n## How it works\n\n1. It takes V8 coverage directly from the the V8 engine while Cypress tests are running\n\n2. After each test, it looks at the V8 coverage object and finds all files served from the application’s URL\n\n3. it takes built source files and finds their corresponding sourcemap files .map\n\n4. the sourcemap files are parsed to find all the source .ts and .tsx files which were loaded and ran by the V8 engine\n\n5. we also find all the files which were NOT loaded by the V8 engine and create dummy coverage files for them, allowing us to get a full view of the coverage of our application. these will have 0% coverage in the final report\n\n6. these files, along with the V8 coverage are then converted to the Istanbul coverage format\n\n7. from there, it is easy to use existing cli tools like `nyc` to convert these istanbul coverage JSON objects into html, text, coburtura, etc, report styles\n\n## Acknowledgements\n\n- [Gleb Bahmutov](https://github.com/glebbahmutov) for the original proof-of-concept for V8 coverage working with Cypress [cypress-native-chrome-code-coverage-example](https://github.com/bahmutov/cypress-native-chrome-code-coverage-example)\n- [Jennifer Shehane](https://github.com/jennifer-shehane) for letting me know that this was [no longer a feature in-progress by the Cypress team](https://github.com/cypress-io/cypress-documentation/commit/280dccb42005d990f159e39330d5d9941a2ff249)\n- [The Vitest Team](https://github.com/vitest-dev/vitest/tree/main) who's V8 coverage code I built on top of for this plugin.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparkuman%2Fcypress-code-coverage-v8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparkuman%2Fcypress-code-coverage-v8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparkuman%2Fcypress-code-coverage-v8/lists"}