A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/bahmutov/docker-with-cypress-included-code-coverage-example below:

bahmutov/docker-with-cypress-included-code-coverage-example: What the name says

docker-with-cypress-included-code-coverage-example

Cypress Docker images with Cypress pre-installed globally at cypress-docker-images

Adding coverage plugin

npm i -D @cypress/code-coverage@2

Added support and task code following the instructions from the cypress-io/code-coverage plugin

Run tests inside a Docker container

$ ./run-cypress.sh
# or run with debug logs from the code coverage plugin
$ DEBUG=code-coverage ./run-cypress.sh

Reason: you have instrumented the source file locally, then ran the tests in the Docker container. The report is generated inside the container but the source file paths are all absolute paths on the local machine, and thus cannot be found.

Note that the summary numbers (number of lines, functions, branches covered) are still correct.

Solution: generate HTML report after exiting from the container (yourself). Code coverage plugin has nyc as a dependency, so it should be available.

# generate HTML report
$ npx nyc report --reporter=lcov
# see just the coverage summary
$ npx nyc report --reporter=text-summary
# see just the coverage by file
$ npx nyc report --reporter=text

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4