cypress-io / cypress-io/code-coverage
Coverage report appears before end of Cypress output?
- Dominant language
- TypeScript
- Stars
- 445
- Forks
- 115
- PR merge metrics
- No merged PRs in 30d
Description
**Logs and screenshots**
Here is what I mean. "removeNodeById" is the last test in my single test file. As you can see, Cypress is correctly using the coverage:report script I defined in package.json. However, it is printing the coverage in the middle of my test results, which isn't blocking but is mildly annoying.
```
...
1) addNode adds a node
...
> ...@1.0.41 coverage:report /Users/admin/.../api
> nyc report
-------------------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
-------------------|---------|----------|---------|---------|-------------------
All files | 100 | 100 | 100 | 100 |
addNodes.ts | 100 | 100 | 100 | 100 |
...
-------------------|---------|----------|---------|---------|-------------------
✓ removeNodeById removes a node (115ms)
4 passing (12s)
1 failing
...
```
**Versions**
- What is this plugin's version? ^3.9.6
- What is Cypress version? ^7.5.0
- What is your operating system? MacOS
- What is the shell? zsh
- What is the Node version? v12.13.0
- What is the NPM version? 6.12.0
- How do you instrument your application? babel-loader w/ istanbul and @babel/preset-typescript
- When running tests, if you open the web application in regular browser, and open DevTools, do you see `window.__coverage__` object? Yup, works great.
- Is there `.nyc_output` folder? Is there `.nyc_output/out.json` file. Coverage is working.
- Do you have any custom NYC settings in `package.json` (`nyc` object) or in other [NYC config files](https://github.com/istanbuljs/nyc#configuration-files)
```
"nyc": {
"extends": "@istanbuljs/nyc-config-typescript",
"extension": [
".ts"
],
"include": [
"src/**/*.ts"
],
"exclude": [
"cypress/",
"dist/",
"src/**/*.d.ts",
"src/**/*.spec.ts"
],
"excludeAfterRemap": false,
"checkCoverage": true,
"all": true,
"branches": 100,
"functions": 100,
"lines": 100,
"statements": 100,
"skipEmpty": true,
"reporter": [
"lcov",
"text"
]
},
```
- Do you run Cypress tests in a Docker container? Nope
**Describe the bug**
I'm confused why the coverage is printing before the outcome of my last test.
**Link to the repo**
Sorry don't have this.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.