Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cypress-io/code-coverage
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.13.1
Choose a base ref
...
head repository: cypress-io/code-coverage
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
8 changes: 5 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -3,13 +3,13 @@ version: 2.1
orbs:
# https://github.com/cypress-io/circleci-orb
cypress: cypress-io/cypress@3.0.0 # used to run e2e tests
win: circleci/windows@5.0.0 # run a test job on Windows
win: circleci/windows@5.1.0 # run a test job on Windows

jobs:
lint:
description: Checks the code formatting
docker:
- image: cimg/node:22.8.0
- image: cimg/node:22.14.0
environment:
# we don't need Cypress to check code style
CYPRESS_INSTALL_BINARY: '0'
@@ -71,7 +71,7 @@ jobs:
publish:
description: Publishes the new version of the plugin to NPM
docker:
- image: cimg/node:22.8.0
- image: cimg/node:22.14.0
environment:
# we don't need Cypress to do the release
CYPRESS_INSTALL_BINARY: '0'
@@ -146,6 +146,7 @@ workflows:
jobname:
- all-files
- backend
- batch-send-coverage
- before-all-visit
- before-each-visit
- cra-e2e-and-ct
@@ -174,6 +175,7 @@ workflows:
- test-code-coverage-plugin
- test-all-files
- test-backend
- test-batch-send-coverage
- test-before-all-visit
- test-before-each-visit
- test-cra-e2e-and-ct
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -251,6 +251,21 @@ After:

![Cypress knows to expect the backend code coverage only](./images/expect-backend.png)

### expectFrontendCoverageOnly

If there is ONLY frontend code coverage, set `expectFrontendCoverageOnly: true` in the `cypress.json` file. Otherwise, Cypress complains that it cannot find the frontend code coverage.

```json
{
"env": {
"codeCoverage": {
"url": "http://localhost:3003/__coverage__",
"expectFrontendCoverageOnly": true
}
}
}
```

## Custom report folder

You can specify a custom report folder by adding `nyc` object to the `package.json` file. For example, to save reports to `cypress-coverage` folder, use:
@@ -549,14 +564,21 @@ Deeply nested objects will sometimes have `[object Object]` values printed. You
DEBUG_DEPTH=10 DEBUG=code-coverage npm run dev
```

### Common issues
## Common issues

Common issue: [not instrumenting your application when running Cypress](#instrument-your-application).

If the plugin worked before in version X but stopped after upgrading to version Y, please try the [released versions](https://github.com/cypress-io/code-coverage/releases) between X and Y to see where the breaking change was.

If you decide to open an issue in this repository, please fill in all information the [issue template](https://github.com/cypress-io/code-coverage/blob/master/.github/ISSUE_TEMPLATE/bug_report.md) asks for. The issues most likely to be resolved have debug logs, screenshots, and hopefully public repository links so we can try running the tests ourselves.

### Coverage reporting timeouts

If the plugin times out when sending coverage report data to be merged, this may be due to a very large
report being sent across processes. You can batch the report by setting the `sendCoverageBatchSize` environment
variable in your `cypress.config.js` file's 'env' section. Assign the variable an integer value representing
the number of report keys to send per batch.

## Contributing

You can test changes locally by running tests and confirming that the code coverage has been calculated and saved.
Loading