Repository navigation
Closed
Labels
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_outputfolder? Is there.nyc_output/out.jsonfile. Coverage is working. - Do you have any custom NYC settings in
package.json(nycobject) or in other NYC config 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.
Reacted by thednp
Activity
mitchwd commentedon Jun 18, 2023
I was having this issue too. My fix was removing
text-summaryfrom thereporterblock in the .nyrc config, and then adding it to my test command in package.json. The lcov and json reports are still built too.docs: tighten console reporter note (#465)
jennifer-shehane commentedon Nov 2, 2026
The report is generated in an
after()hook at the end of each spec, while Cypress is still printing results, so console reporters (text,text-summary) and acoverage:reportscript that prints can appear before the last test's result. The coverage numbers are not affected.Workaround: use only file reporters in the nyc config and print the summary after the run:
{ "nyc": { "reporter": ["lcov", "json"] }, "scripts": { "test": "cypress run && nyc report --reporter=text-summary" } }Documented in #1009: Console reporters print mid-run. A way to skip the per-spec report is requested in #506.
github-actions commentedon Nov 2, 2026
🎉 This issue has been resolved in version 4.1.3 🎉
The release is available on:
Your semantic-release bot 📦🚀