Allow for declaring the nycrcPath to use custom-named configuration files.
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- cypress, typescript
- 领域
- testing
调研方向
首先跟踪 Cypress 配置如何读取 NYC 设置,以及 plugin 当前如何发现默认的 .nycrc 文件。检查现有的配置和 coverage 测试,然后验证是否支持通过 config.nycrcPath 或 config.env.nycrcPath 提供自定义路径。完成标准是 Cypress 使用所选配置,同时保留现有的默认行为。
由索引模型根据 Issue 内容生成。
描述
Is your feature request related to a problem? Please describe.
Right now, this plugin supports loading default named ".nycrcfiles, but cannot utilize a custom named one, like.nycrc.config.cypress.js`. An option to provide custom configuration options exist for other test frameworks, like vitest.
Specifically in the case I am using, I need to have distinct outputs between unit and component test coverage, where Vitest handles unit tests, and Cypress handles component tests. This is due to limitations of how Cypress handles source maps versus Vitest where line lengths do not align properly (and this is well-documented in this repo and in the official nyc repo as well). To avoid that issue, I need separate .nycrc configs for both test frameworks.
Cypress currently only supports default named .nycrc files, or a configuration defined in the package.json, but this limits how we can use nyc as it prefers the configuration used for Cypress over any other configurations that can exist. This is a problem if we need to merge results and report on total coverage combined by both, running nyc report will ignore the files matched in the unit test configuration.
Describe the solution you'd like
The plugin should allow for calling a custom nycrcPath when being declared in the Cypress configuration, either by config.nycrcPath or config.env.nycrcPath.
For an example, see here:
https://github.com/iFaxity/vite-plugin-istanbul?tab=readme-ov-file#istanbulplugin--opts--
Describe alternatives you've considered
I will need to use three .nycrc configurations which is incredibly messy:
.nycrc.config.mjs, a default config used only for accurate reporting of merged component + unit test code coverage results. This would be called in a command likenpx nyc report --nycrc-path=./.nycrc.config.mjs. Specifying the path is necessary here..nycrc.config.component.mjs, a Cypress-specific configuration extended from the default; it must be loaded as part of thepackage.jsonusing"nyc": { "extends": "./.nycrc.config.component.mjs" }. Runningnpx nyc reportwithout declaring the path will utilize this config instead of the default, which is the main issue..nycrc.config.unit.mjsfor Vitest files only.
Additional context
Add any other context or screenshots about the feature request here.
- 主要语言
- TypeScript
- 星标
- 440
- 派生
- 114
- 平均合并
- 42 分钟
- 30 天内合并 PR
- 19
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
cypress-io/code-coverage 的其他 Issue
-
难度 3/5 半天 新手友好度 40/100
cypress-io/code-coverage#1018 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
cypress-io/code-coverage#993 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 45/100
cypress-io/code-coverage#959 ·
维护者通常 1 天内回复
-
performance
难度 4/5 3-5 天 新手友好度 42/100
cypress-io/code-coverage#933 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 35/100
cypress-io/code-coverage#928 · 1 条评论 · 4 个 reaction ·
维护者通常 1 天内回复
查看 cypress-io/code-coverage 的全部 Issue
相似的 Issue
-
Recording drops clicks on links, filters and checkboxes that share a form with a search field可能已有人在做 @columbia11 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
Tencent/BrowserSkill#657 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 65/100
维护者通常 2 天内回复
-
Choosing a folder while continuing an Antigravity session submits a history fork the runtime rejects未关闭
难度 2/5 1-3 小时 新手友好度 87/100
-
ai-handle
难度 2/5 1-3 小时 新手友好度 78/100
nextlevelbuilder/dewee-web-v2#138 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
NEARBuilders/citynode.app#512 ·
维护者通常 1 天内回复