`all:true` not working with Next application

未关闭
#552 10 条评论 4 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
38/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
cypress, next.js, typescript

调研方向

报告指出了 package.json 中的 nyc.all 设置、.nyc_output/out.json,以及一个通过 Cypress 执行的 Next 应用。首先使用 all:true 复现,并比较已加载页面和未加载页面的覆盖率;当 NYC all 选中的文件出现在覆盖率输出中时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Versions

  • What is this plugin's version? 3.9.12
  • What is Cypress version? 8.2.0
  • What is your operating system? Mac OS 12.1
  • What is the shell? ZSH
  • What is the Node version? 14.18.2
  • What is the NPM version? 8.3.2
  • How do you instrument your application? Cypress does not instrument web application code, so you need to do it yourself.
    Like mentioned in the installation guide here
  • When running tests, if you open the web application in regular browser, and open DevTools, do you see window.__coverage__ object? Can you paste a screenshot?

I don't think I do but I get coverage in the end.

  • Is there .nyc_output folder? Is there .nyc_output/out.json file. Is it empty? Can you paste at least part of it so we can see the keys and file paths?

This is generated, but no empty objects for empty files.

  • Do you have any custom NYC settings in package.json (nyc object) or in other NYC config files
  "nyc": {
    "all": true
  }
  • Do you run Cypress tests in a Docker container?
    No

Describe the bug
I use the option all:true but I don't see all files. For example I have some files in pages/.. which are not displayed at all. It seems that just loaded files are used.

The NYC options from the package.json are used because I fiddled around with the include parameter and it is filtering, so that seems to work. I don't see any difference in the output if I use true or false for the all option.

主要语言
TypeScript
星标
440
派生
114
平均合并
42 分钟
30 天内合并 PR
19

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cypress-io/code-coverage 的其他 Issue

查看 cypress-io/code-coverage 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。